](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a8fdc429c39a619d9935d9d15efbed87d)
()
|  Get the names of the named robot states available as targets, both either
remembered states or default states from srdf.  More...

std::map< std::string, double > |  [ getNamedTargetValues
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a45eb7b78bf81f9fc429b8e91c66706b3)
(const std::string &name)
|  Get the joint angles for targets specified by name.  More...

const [ ros::NodeHandle
](../../../api/roscpp/html/classros_1_1NodeHandle.html) & |  [ getNodeHandle
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#af6837d4030a8b96ce251ebbf614d0158)
() const
|  Get the ROS node handle of this instance operates on.  More...

const std::string & |  [ getPlannerId
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#af89d6aeacd5bfc344bf6d3b404fb7d7a)
() const
|  Get the current planner_id.  More...

std::map< std::string, std::string > |  [ getPlannerParams
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a82c7b1757d22c71d52fa657307a241b2)
(const std::string &planner_id, const std::string &group="")
|  Get the planner parameters for given group and planner_id.  More...

const std::string & |  [ getPlanningFrame
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#ab20ccac5f7cce02a907dfb6c1ee9f544)
() const
|  Get the name of the frame in which the robot is planning.  More...

double  |  [ getPlanningTime
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a8ce1416ccaf06e62e51a86e1e652968b)
() const
|  Get the number of seconds set by [ setPlanningTime()
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#af4631a849c750b4c1428242475c8988d
"Specify the maximum amount of time to use when planning. ") More...

robot_model::RobotModelConstPtr  |  [ getRobotModel
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#aad1f1ce64bbc8c7c275da6eb0b1b1510)


}
void MoveGroupInterface::setPoseReferenceFrame(const std::string& pose_reference_frame)
{
  impl_->setPoseReferenceFrame(pose_reference_frame);
}
const std::string& MoveGroupInterface::getPoseReferenceFrame() const
{
  return impl_->getPoseReferenceFrame();
}
double MoveGroupInterface::getGoalJointTolerance() const
{
  return impl_->getGoalJointTolerance();
}
double MoveGroupInterface::getGoalPositionTolerance() const
{
  return impl_->getGoalPositionTolerance();
}
double MoveGroupInterface::getGoalOrientationTolerance() const
{
  return impl_->getGoalOrientationTolerance();
}
void MoveGroupInterface::setGoalTolerance(double tolerance)
{
  setGoalJointTolerance(tolerance);
  setGoalPositionTolerance(tolerance);
  setGoalOrientationTolerance(tolerance);
}
void MoveGroupInterface::setGoalJointTolerance(double tolerance)
{
  impl_->setGoalJointTolerance(tolerance);
}
void MoveGroupInterface::setGoalPositionTolerance(double tolerance)
{
  impl_->setGoalPositionTolerance(tolerance);
}
void MoveGroupInterface::setGoalOrientationTolerance(double tolerance)
{
  impl_->setGoalOrientationTolerance(tolerance);
}
void MoveGroupInterface::rememberJointValues(const std::string& name)


[ moveit::planning_interface::MoveGroupInterface::Options::robot_description_
](structmoveit_1_1planning__interface_1_1MoveGroupInterface_1_1Options.html#a6d808c8691c7bb9f96ea7c586046b439)


[ tf.h ](../../../api/tf/html/c++/tf_8h.html)


216  bool  getInterfaceDescription(moveit_msgs::PlannerInterfaceDescription&
desc);


    namespace rvt = rviz_visual_tools;
    moveit_visual_tools::MoveItVisualTools visual_tools("panda_link0");
    visual_tools.deleteAllMarkers();


        node_, rclcpp::names::append(opt_.move_group_namespace, move_group::EXECUTE_ACTION_NAME), callback_group_);
    execute_action_client_->wait_for_action_server(wait_for_servers.to_chrono<std::chrono::duration<double>>());
    query_service_ = node_->create_client<moveit_msgs::srv::QueryPlannerInterfaces>(
        rclcpp::names::append(opt_.move_group_namespace, move_group::QUERY_PLANNERS_SERVICE_NAME), qosDefault(),
        callback_group_);
    get_params_service_ = node_->create_client<moveit_msgs::srv::GetPlannerParams>(
        rclcpp::names::append(opt_.move_group_namespace, move_group::GET_PLANNER_PARAMS_SERVICE_NAME), qosDefault(),
        callback_group_);
    set_params_service_ = node_->create_client<moveit_msgs::srv::SetPlannerParams>(
        rclcpp::names::append(opt_.move_group_namespace, move_group::SET_PLANNER_PARAMS_SERVICE_NAME), qosDefault(),
        callback_group_);
    cartesian_path_service_ = node_->create_client<moveit_msgs::srv::GetCartesianPath>(
        rclcpp::names::append(opt_.move_group_namespace, move_group::CARTESIAN_PATH_SERVICE_NAME), qosDefault(),
        callback_group_);
    RCLCPP_INFO_STREAM(logger_, "Ready to take commands for planning group " << opt.group_name << '.');
  }
  ~MoveGroupInterfaceImpl()
  {
    if (constraints_init_thread_)
      constraints_init_thread_->join();
    callback_executor_.cancel();
    if (callback_thread_.joinable())
      callback_thread_.join();
  }
  const std::shared_ptr<tf2_ros::Buffer>& getTF() const
  {
    return tf_buffer_;
  }
  const Options& getOptions() const
  {
    return opt_;
  }
  const moveit::core::RobotModelConstPtr& getRobotModel() const
  {
    return robot_model_;
  }
  const moveit::core::JointModelGroup* getJointModelGroup() const
  {
    return joint_model_group_;
  }


Get the currently remembered map of names to joint values.


The documentation for this struct was generated from the following file:


494  const  robot_state::RobotState& getJointValueTarget()  const  ;


    visual_tools.publishText(text_pose, "Objects removed", rvt::WHITE, rvt::XLARGE);
    visual_tools.trigger();

    /* Wait for MoveGroup to receive and process the attached collision object message */
    visual_tools.prompt("Press 'next' in the RvizVisualToolsGui window to once the collision object disappears");


bool moveit::planning_interface::MoveGroupInterface::setJointValueTarget  |  (
|  const std::map< std::string, double > & |  _variable_values_ |  )  |
---|---|---|---|---|---

Set the JointValueTarget and use it for future planning requests.


161  [ MoveGroupInterface
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html) (  const
std::string& [ group
](namespacemovegroup__interface.html#abd91430536f622d99cd24987c32c6d55) ,


    moveit_msgs::CollisionObject object_to_attach;
    object_to_attach.id = "cylinder1";

    shape_msgs::SolidPrimitive cylinder_primitive;
    cylinder_primitive.type = primitive.CYLINDER;
    cylinder_primitive.dimensions.resize(2);
    cylinder_primitive.dimensions[primitive.CYLINDER_HEIGHT] = 0.20;
    cylinder_primitive.dimensions[primitive.CYLINDER_RADIUS] = 0.04;


moveit_msgs::RobotTrajectory
moveit::planning_interface::MoveGroupInterface::Plan::trajectory_
---

The trajectory of the robot (may not contain joints that are the same as for
the start_state_)


72  }


928  private  :


bool moveit::planning_interface::MoveGroupInterface::setJointValueTarget  |  (
|  const std::string & |  _joint_name_ ,
---|---|---|---
|  |  const std::vector< double > & |  _values_
|  )  |  |

Set the JointValueTarget and use it for future planning requests.


53  #include < [ actionlib/client/simple_action_client.h
](../../../api/actionlib/html/simple__action__client_8h.html) >


  }
  geometry_msgs::msg::PoseStamped pose_msg;
  pose_msg.header.stamp = impl_->getClock()->now();
  pose_msg.header.frame_id = impl_->getRobotModel()->getModelFrame();
  pose_msg.pose = tf2::toMsg(pose);
  return pose_msg;
}
geometry_msgs::msg::PoseStamped MoveGroupInterface::getCurrentPose(const std::string& end_effector_link) const
{
  const std::string& eef = end_effector_link.empty() ? getEndEffectorLink() : end_effector_link;
  Eigen::Isometry3d pose;
  pose.setIdentity();
  if (eef.empty())
  {
    RCLCPP_ERROR(logger_, "No end-effector specified");
  }
  else
  {
    moveit::core::RobotStatePtr current_state;
    if (impl_->getCurrentState(current_state))
    {
      const moveit::core::LinkModel* lm = current_state->getLinkModel(eef);
      if (lm)
        pose = current_state->getGlobalLinkTransform(lm);
    }
  }
  geometry_msgs::msg::PoseStamped pose_msg;
  pose_msg.header.stamp = impl_->getClock()->now();
  pose_msg.header.frame_id = impl_->getRobotModel()->getModelFrame();
  pose_msg.pose = tf2::toMsg(pose);
  return pose_msg;
}
std::vector<double> MoveGroupInterface::getCurrentRPY(const std::string& end_effector_link) const
{
  std::vector<double> result;
  const std::string& eef = end_effector_link.empty() ? getEndEffectorLink() : end_effector_link;
  if (eef.empty())
  {
    RCLCPP_ERROR(logger_, "No end-effector specified");
  }


380  bool  setJointValueTarget(  const  std::string& joint_name,  const
std::vector<double>& values);


  * [ Main Page  ](index.html)
  * [ Related Pages  ](pages.html)
  * [ Namespaces  ](namespaces.html)
  * [ Classes  ](annotated.html)
  * [ Files  ](files.html)


The amount of time it took to generate the plan.


89  };


Definition at line [ 98 ](move__group__interface_8h_source.html#l00098) of
file [ move_group_interface.h ](move__group__interface_8h_source.html) .


See the [ YouTube video ](https://youtu.be/_5siHkFQPBQ) at the top of this
tutorial for expected output. In RViz, we should be able to see the following:


    * [ Simple Controller Manager ](../controller_configuration/controller_configuration_tutorial.html#simple-controller-manager)
      * [ Controller Mapping ](../controller_configuration/controller_configuration_tutorial.html#controller-mapping)
      * [ FollowJointTrajectory Controller Interface ](../controller_configuration/controller_configuration_tutorial.html#followjointtrajectory-controller-interface)
      * [ GripperCommand Controller Interface ](../controller_configuration/controller_configuration_tutorial.html#grippercommand-controller-interface)
      * [ Optional Allowed Trajectory Execution Duration Parameters ](../controller_configuration/controller_configuration_tutorial.html#optional-allowed-trajectory-execution-duration-parameters)
    * [ ROS Control Controller Manager ](../controller_configuration/controller_configuration_tutorial.html#ros-control-controller-manager)
    * [ Multi Controller Manager ](../controller_configuration/controller_configuration_tutorial.html#multi-controller-manager)
      * [ Controller Switching and Namespaces ](../controller_configuration/controller_configuration_tutorial.html#controller-switching-and-namespaces)
    * [ Fake Controller Manager ](../controller_configuration/controller_configuration_tutorial.html#fake-controller-manager)
    * [ Integrating Controllers ](../controller_configuration/controller_configuration_tutorial.html#integrating-controllers)
      * [ ROS Controllers with a ` FollowJointTrajectory  ` action interface ](../controller_configuration/controller_configuration_tutorial.html#ros-controllers-with-a-followjointtrajectory-action-interface)
      * [ ROS Controllers with another interface ](../controller_configuration/controller_configuration_tutorial.html#ros-controllers-with-another-interface)
    * [ Remapping ` /joint_states  ` topic ](../controller_configuration/controller_configuration_tutorial.html#remapping-joint-states-topic)
  * [ Perception Pipeline Tutorial ](../perception_pipeline/perception_pipeline_tutorial.html)
    * [ Getting Started ](../perception_pipeline/perception_pipeline_tutorial.html#getting-started)
    * [ Configuration ](../perception_pipeline/perception_pipeline_tutorial.html#configuration)
      * [ YAML Configuration file (Point Cloud) ](../perception_pipeline/perception_pipeline_tutorial.html#yaml-configuration-file-point-cloud)
      * [ YAML Configuration file (Depth Map) ](../perception_pipeline/perception_pipeline_tutorial.html#yaml-configuration-file-depth-map)
      * [ Update the launch file ](../perception_pipeline/perception_pipeline_tutorial.html#update-the-launch-file)
        * [ Add the YAML file to the launch script ](../perception_pipeline/perception_pipeline_tutorial.html#add-the-yaml-file-to-the-launch-script)
        * [ Octomap Configuration ](../perception_pipeline/perception_pipeline_tutorial.html#octomap-configuration)
    * [ Obstacle Avoidance ](../perception_pipeline/perception_pipeline_tutorial.html#obstacle-avoidance)
      * [ Running the Interface ](../perception_pipeline/perception_pipeline_tutorial.html#running-the-interface)
    * [ Detecting and Adding Object as Collision Object ](../perception_pipeline/perception_pipeline_tutorial.html#detecting-and-adding-object-as-collision-object)
      * [ Running the Code ](../perception_pipeline/perception_pipeline_tutorial.html#running-the-code)
      * [ Relevant Code ](../perception_pipeline/perception_pipeline_tutorial.html#relevant-code)
        * [ Perception Related ](../perception_pipeline/perception_pipeline_tutorial.html#perception-related)
        * [ Storing Relevant Cylinder Values ](../perception_pipeline/perception_pipeline_tutorial.html#storing-relevant-cylinder-values)
        * [ Extracting Location and Height ](../perception_pipeline/perception_pipeline_tutorial.html#extracting-location-and-height)
        * [ Adding Cylinder to Planning Scene ](../perception_pipeline/perception_pipeline_tutorial.html#adding-cylinder-to-planning-scene)
  * [ Hand-Eye Calibration ](../hand_eye_calibration/hand_eye_calibration_tutorial.html)
    * [ Getting Started ](../hand_eye_calibration/hand_eye_calibration_tutorial.html#getting-started)
    * [ Clone and Build the MoveIt Calibration Repo ](../hand_eye_calibration/hand_eye_calibration_tutorial.html#clone-and-build-the-moveit-calibration-repo)
    * [ Launch RViz and Load Calibration Plugin ](../hand_eye_calibration/hand_eye_calibration_tutorial.html#launch-rviz-and-load-calibration-plugin)
    * [ Create and Print a Target ](../hand_eye_calibration/hand_eye_calibration_tutorial.html#create-and-print-a-target)
    * [ Geometric Context ](../hand_eye_calibration/hand_eye_calibration_tutorial.html#geometric-context)
    * [ Collect Dataset ](../hand_eye_calibration/hand_eye_calibration_tutorial.html#collect-dataset)
    * [ Calculate a Calibration ](../hand_eye_calibration/hand_eye_calibration_tutorial.html#calculate-a-calibration)
  * [ IKFast Kinematics Solver ](../ikfast/ikfast_tutorial.html)
    * [ What is IKFast? ](../ikfast/ikfast_tutorial.html#what-is-ikfast)


Visualize the plan in RViz


Definition at line [ 2200 ](move__group__interface_8cpp_source.html#l02200) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


Definition at line [ 2057 ](move__group__interface_8cpp_source.html#l02057) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


__ [ moveit_tutorials ](../../index.html)


936  #endif


[ moveit::planning_interface::MoveItErrorCode
](classmoveit_1_1planning__interface_1_1MoveItErrorCode.html)
moveit::planning_interface::MoveGroupInterface::plan  |  (  |  [ Plan
](structmoveit_1_1planning__interface_1_1MoveGroupInterface_1_1Plan.html) & |
_plan_ |  )  |
---|---|---|---|---|---

Compute a motion plan that takes the group declared in the constructor from
the current state to the specified target. No execution is performed. The
resulting plan is stored in _plan_ .


793  [ MoveItErrorCode
](classmoveit_1_1planning__interface_1_1MoveItErrorCode.html) place(  const
std::string& object  ,  const  std::vector<geometry_msgs::PoseStamped>& poses,


    geometry_msgs::Pose box_pose;
    box_pose.orientation.w = 1.0;
    box_pose.position.x = 0.5;
    box_pose.position.y = 0.0;
    box_pose.position.z = 0.25;

    collision_object.primitives.push_back(primitive);
    collision_object.primitive_poses.push_back(box_pose);
    collision_object.operation = collision_object.ADD;

    std::vector<moveit_msgs::CollisionObject> collision_objects;
    collision_objects.push_back(collision_object);


[ 105
](structmoveit_1_1planning__interface_1_1MoveGroupInterface_1_1Options.html)
struct  [ Options
](structmoveit_1_1planning__interface_1_1MoveGroupInterface_1_1Options.html)


const std::map< std::string, std::vector< double > > &
getRememberedJointValues() const


[ ros::WallDuration ](../../../api/rostime/html/classros_1_1WallDuration.html)


  std::map<std::string, std::vector<double>>::const_iterator it = remembered_joint_values_.find(name);
  if (it != remembered_joint_values_.end())
  {
    return setJointValueTarget(it->second);
  }
  else
  {
    if (impl_->getTargetRobotState().setToDefaultValues(impl_->getJointModelGroup(), name))
    {
      impl_->setTargetType(JOINT);
      return true;
    }
    RCLCPP_ERROR(logger_, "The requested named target '%s' does not exist", name.c_str());
    return false;
  }
}
void MoveGroupInterface::getJointValueTarget(std::vector<double>& group_variable_values) const
{
  impl_->getTargetRobotState().copyJointGroupPositions(impl_->getJointModelGroup(), group_variable_values);
}
bool MoveGroupInterface::setJointValueTarget(const std::vector<double>& joint_values)
{
  const auto n_group_joints = impl_->getJointModelGroup()->getVariableCount();
  if (joint_values.size() != n_group_joints)
  {
    RCLCPP_DEBUG_STREAM(logger_, "Provided joint value list has length " << joint_values.size() << " but group "
                                                                         << impl_->getJointModelGroup()->getName()
                                                                         << " has " << n_group_joints << " joints");
    return false;
  }
  impl_->setTargetType(JOINT);
  impl_->getTargetRobotState().setJointGroupPositions(impl_->getJointModelGroup(), joint_values);
  return impl_->getTargetRobotState().satisfiesBounds(impl_->getJointModelGroup(), impl_->getGoalJointTolerance());
}
bool MoveGroupInterface::setJointValueTarget(const std::map<std::string, double>& variable_values)
{
  const auto& allowed = impl_->getJointModelGroup()->getVariableNames();
  for (const auto& pair : variable_values)
  {
    if (std::find(allowed.begin(), allowed.end(), pair.first) == allowed.end())


Batch publishing is used to reduce the number of messages being sent to RViz
for large visualizations


The entire code can be seen [ here in the MoveIt GitHub project
](https://github.com/ros-
planning/moveit_tutorials/blob/master/doc/move_group_interface/src/move_group_interface_tutorial.cpp)
. Next we step through the code piece by piece to explain its functionality.


Set time allowed to planner to solve problem before aborting.


151  const  [ ros::WallDuration
](../../../api/rostime/html/classros_1_1WallDuration.html) & wait_for_servers
= [ ros::WallDuration
](../../../api/rostime/html/classros_1_1WallDuration.html) ());


[ moveit::planning_interface::MoveItErrorCode::MoveItErrorCode
](classmoveit_1_1planning__interface_1_1MoveItErrorCode.html#adeb720f484d065de44084139fcc54401)


631  bool  setEndEffectorLink(  const  std::string& end_effector_link);


162  const  [ boost::shared_ptr<tf::Transformer>
](../../../api/roscpp_traits/html/classboost_1_1shared__ptr.html) & [ tf
](../../../api/eigen_conversions/html/namespacetf.html) = [
boost::shared_ptr<tf::Transformer>
](../../../api/roscpp_traits/html/classboost_1_1shared__ptr.html) (),


This is different from [ setPoseTarget()
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a5747a91e791f0089b784e3af2dbf4260
"Set the goal pose of the end-effector end_effector_link. ") in that a single
IK state (aka JointValueTarget) is computed using IK, and the resulting
JointValueTarget is used as the target for planning.


bool moveit::planning_interface::MoveGroupInterface::detachObject  |  (  |
const std::string & |  _name_ = ` "" ` |  )  |
---|---|---|---|---|---

Detach an object. _name_ specifies the name of the object attached to this
group, or the name of the link the object is attached to. If there is no name
specified, and there is only one attached object, that object is detached. An
error is produced if no object to detach is identified.


This new orientation target replaces any pre-existing JointValueTarget or pre-
existing Position, Orientation, or Pose target(s) for this _end_effector_link_
.


[ name
](../../../api/eigenpy/html/namespacecompile.html#a46be63463291fe312cb52b5643ad6c3a)


Definition at line [ 1547 ](move__group__interface_8cpp_source.html#l01547) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


ROS_INFO_NAMED("tutorial", "Planning frame: %s", move_group_interface.getPlanningFrame().c_str());


Definition at line [ 1676 ](move__group__interface_8cpp_source.html#l01676) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


After this call, the JointValueTarget is used **instead** of any previously
set Position, Orientation, or Pose targets.


**Definition:** [ move_group_interface.h:929
](move__group__interface_8h_source.html#l00929)


[ deprecation.h ](../../../api/moveit_core/html/deprecation_8h.html)


const std::string &
moveit::planning_interface::MoveGroupInterface::getPlanningFrame  |  (  |  |
)  |  const
---|---|---|---|---

Get the name of the frame in which the robot is planning.


[ planning_interface ](http://wiki.ros.org/planning_interface)
Author(s): Ioan Sucan  autogenerated on Sun Oct 18 2020 13:18:50


[ moveit::planning_interface::MoveItErrorCode
](classmoveit_1_1planning__interface_1_1MoveItErrorCode.html)
moveit::planning_interface::MoveGroupInterface::place  |  (  |  const
std::string & |  _object_ ,
---|---|---|---
|  |  const std::vector< moveit_msgs::PlaceLocation > & |  _locations_ ,
|  |  bool  |  _plan_only_ = ` false `
|  )  |  |

Place an object at one of the specified possible locations.


721  moveit_msgs::MoveItErrorCodes* error_code = NULL);


**Definition:** [ move_group_interface.h:131
](move__group__interface_8h_source.html#l00131)


Definition at line [ 1629 ](move__group__interface_8cpp_source.html#l01629) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


##  The Launch File  ¶


Definition at line [ 1712 ](move__group__interface_8cpp_source.html#l01712) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


58  {


Definition at line [ 2052 ](move__group__interface_8cpp_source.html#l02052) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


Definition at line [ 2042 ](move__group__interface_8cpp_source.html#l02042) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


This is different from [ setPoseTarget()
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a5747a91e791f0089b784e3af2dbf4260
"Set the goal pose of the end-effector end_effector_link. ") in that a single
IK state (aka JointValueTarget) is computed using IK, and the resulting
JointValueTarget is used as the target for planning.


    ROS_INFO_NAMED("tutorial", "Visualizing plan 1 as trajectory line");
    visual_tools.publishAxisLabeled(target_pose1, "pose1");
    visual_tools.publishText(text_pose, "Pose Goal", rvt::WHITE, rvt::XLARGE);
    visual_tools.publishTrajectoryLine(my_plan.trajectory_, joint_model_group);
    visual_tools.trigger();
    visual_tools.prompt("Press 'next' in the RvizVisualToolsGui window to continue the demo");


Built with [ Sphinx ](http://sphinx-doc.org/) using a [ theme
](https://github.com/snide/sphinx_rtd_theme) provided by [ Read the Docs
](https://readthedocs.org) .


    shape_msgs::SolidPrimitive primitive;
    primitive.type = primitive.BOX;
    primitive.dimensions.resize(3);
    primitive.dimensions[primitive.BOX_X] = 0.1;
    primitive.dimensions[primitive.BOX_Y] = 1.5;
    primitive.dimensions[primitive.BOX_Z] = 0.5;


You can execute a trajectory like this:
move_group_interface.execute(trajectory);


|  moveit::planning_interface::MoveGroupInterface::MoveGroupInterface  |  (  |
const [ MoveGroupInterface
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html) & |  |  )  |
---|---|---|---|---|---
delete

This class owns unique resources (e.g. action clients, threads) and its not
very meaningful to copy. Pass by references, move it, or simply create
multiple instances where required.


Definition at line [ 1422 ](move__group__interface_8cpp_source.html#l01422) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


void
moveit::planning_interface::MoveGroupInterface::constructMotionPlanRequest  |
(  |  [ moveit_msgs::MotionPlanRequest
](../../../api/moveit_core/html/namespaceplanning__interface.html#a66b7da9ae05ece3dbde7605d89208ae8)
& |  _request_ |  )  |
---|---|---|---|---|---

Build the MotionPlanRequest that would be sent to the [ move_group
](../../../api/moveit_ros_manipulation/html/namespacemove__group.html) action
with [ plan()
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#ad72e3d9367374e388546c8e81f26035a
"Compute a motion plan that takes the group declared in the constructor from
the current state to the ...") or [ move()
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a3513c41b0c73400fc6713b25bc6b1637
"Plan and execute a trajectory that takes the group of joints declared in the
constructor to the speci...") and store it in _request_ .


std::map< std::string, double >
moveit::planning_interface::MoveGroupInterface::getNamedTargetValues  |  (  |
const std::string & |  _name_ |  )  |
---|---|---|---|---|---

Get the joint angles for targets specified by name.


###  Visualizing plans  ¶


  else
  {
    moveit::core::RobotStatePtr current_state;
    if (impl_->getCurrentState(current_state))
    {
      const moveit::core::LinkModel* lm = current_state->getLinkModel(eef);
      if (lm)
      {
        result.resize(3);
        geometry_msgs::msg::TransformStamped tfs = tf2::eigenToTransform(current_state->getGlobalLinkTransform(lm));
        double pitch, roll, yaw;
        tf2::getEulerYPR<geometry_msgs::msg::Quaternion>(tfs.transform.rotation, yaw, pitch, roll);
        result[0] = roll;
        result[1] = pitch;
        result[2] = yaw;
      }
    }
  }
  return result;
}
const std::vector<std::string>& MoveGroupInterface::getActiveJoints() const
{
  return impl_->getJointModelGroup()->getActiveJointModelNames();
}
const std::vector<std::string>& MoveGroupInterface::getJoints() const
{
  return impl_->getJointModelGroup()->getJointModelNames();
}
unsigned int MoveGroupInterface::getVariableCount() const
{
  return impl_->getJointModelGroup()->getVariableCount();
}
moveit::core::RobotStatePtr MoveGroupInterface::getCurrentState(double wait) const
{
  moveit::core::RobotStatePtr current_state;
  impl_->getCurrentState(current_state, wait);
  return current_state;
}
void MoveGroupInterface::rememberJointValues(const std::string& name, const std::vector<double>& values)
{


**Definition:** [ move_group_interface.h:134
](move__group__interface_8h_source.html#l00134)


if the vector is left empty this behaves like pick(const std::string &object)


50  #include <moveit_msgs/MotionPlanRequest.h>


After this call, the JointValueTarget is used **instead** of any previously
set Position, Orientation, or Pose targets.


    std::map<std::string, std::string> result;
    auto future_response = get_params_service_->async_send_request(req);
    if (future_response.valid())
    {
      response = future_response.get();
      for (unsigned int i = 0, end = response->params.keys.size(); i < end; ++i)
        result[response->params.keys[i]] = response->params.values[i];
    }
    return result;
  }
  void setPlannerParams(const std::string& planner_id, const std::string& group,
                        const std::map<std::string, std::string>& params, bool replace = false)
  {
    auto req = std::make_shared<moveit_msgs::srv::SetPlannerParams::Request>();
    req->planner_config = planner_id;
    req->group = group;
    req->replace = replace;
    for (const std::pair<const std::string, std::string>& param : params)
    {
      req->params.keys.push_back(param.first);
      req->params.values.push_back(param.second);
    }
    set_params_service_->async_send_request(req);
  }
  std::string getDefaultPlanningPipelineId() const
  {
    std::string default_planning_pipeline;
    node_->get_parameter("move_group.default_planning_pipeline", default_planning_pipeline);
    return default_planning_pipeline;
  }
  void setPlanningPipelineId(const std::string& pipeline_id)
  {
    if (pipeline_id != planning_pipeline_id_)
    {
      planning_pipeline_id_ = pipeline_id;
      // Reset planner_id if planning pipeline changed
      planner_id_ = "";
    }
  }
  const std::string& getPlanningPipelineId() const


[ class_forward.h ](../../../api/moveit_core/html/class__forward_8h.html)


Replan, but now with the object in hand.


double moveit::planning_interface::MoveGroupInterface::Plan::planning_time_
---

The amount of time it took to generate the plan.


Definition at line [ 2269 ](move__group__interface_8cpp_source.html#l02269) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


The [ MoveGroupInterface
](http://docs.ros.org/noetic/api/moveit_ros_planning_interface/html/classmoveit_1_1planning__interface_1_1MoveGroupInterface.html)
class can be easily setup using just the name of the planning group you would
like to control and plan for.


moveit::planning_interface::MoveGroupInterface::MOVEIT_STRUCT_FORWARD  |  (  |
[ Plan
](structmoveit_1_1planning__interface_1_1MoveGroupInterface_1_1Plan.html) |  |
)  |
---|---|---|---|---|---

|  [ MoveGroupInterface
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html) &
moveit::planning_interface::MoveGroupInterface::operator=  |  (  |  const [
MoveGroupInterface
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html) & |  |  )  |
---|---|---|---|---|---
delete

[ moveit::planning_interface::MoveGroupInterface
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html) &
moveit::planning_interface::MoveGroupInterface::operator=  |  (  |  [
MoveGroupInterface
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html) && |  _other_
|  )  |
---|---|---|---|---|---

Definition at line [ 1409 ](move__group__interface_8cpp_source.html#l01409) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


Client class to conveniently use the ROS interfaces provided by the [
move_group
](../../../api/moveit_ros_manipulation/html/namespacemove__group.html) node. [
More...
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#details)


[ moveit::planning_interface::MoveItErrorCode::operator==
](classmoveit_1_1planning__interface_1_1MoveItErrorCode.html#ad7c12c18bec22efc4271b565950a3803)


const std::vector< std::string > &
moveit::planning_interface::MoveGroupInterface::getJointNames  |  (  |  |  )
|
---|---|---|---|---

Get vector of names of joints available in move group.


191  const  [ ros::NodeHandle
](../../../api/roscpp/html/structros_1_1NodeHandle_1_1no__validate.html) &
getNodeHandle()  const  ;


_state_ is used to set the target joint state values. Values not specified in
_state_ remain unchanged.


10  * are met:


911  bool  setPathConstraints(  const  std::string& constraint);


**Definition:** [ move_group_interface.cpp:91
](move__group__interface_8cpp_source.html#l00091)


41  #include < [ moveit/macros/class_forward.h
](../../../api/moveit_core/html/class__forward_8h.html) >


rclcpp_action::Client<moveit_msgs::action::MoveGroup>& MoveGroupInterface::getMoveGroupClient() const
{
  return impl_->getMoveGroupClient();
}
moveit::core::MoveItErrorCode MoveGroupInterface::move()
{
  return impl_->move(true);
}
moveit::core::MoveItErrorCode MoveGroupInterface::asyncExecute(const Plan& plan,
                                                               const std::vector<std::string>& controllers)
{
  return impl_->execute(plan.trajectory, false, controllers);
}
moveit::core::MoveItErrorCode MoveGroupInterface::asyncExecute(const moveit_msgs::msg::RobotTrajectory& trajectory,
                                                               const std::vector<std::string>& controllers)
{
  return impl_->execute(trajectory, false, controllers);
}
moveit::core::MoveItErrorCode MoveGroupInterface::execute(const Plan& plan, const std::vector<std::string>& controllers)
{
  return impl_->execute(plan.trajectory, true, controllers);
}
moveit::core::MoveItErrorCode MoveGroupInterface::execute(const moveit_msgs::msg::RobotTrajectory& trajectory,
                                                          const std::vector<std::string>& controllers)
{
  return impl_->execute(trajectory, true, controllers);
}
moveit::core::MoveItErrorCode MoveGroupInterface::plan(Plan& plan)
{
  return impl_->plan(plan);
}
// moveit_msgs::action::Pickup::Goal MoveGroupInterface::constructPickupGoal(const std::string& object,
//                                                                        std::vector<moveit_msgs::msg::Grasp> grasps,
//                                                                        bool plan_only = false) const
//{
//  return impl_->constructPickupGoal(object, std::move(grasps), plan_only);
//}
//
// moveit_msgs::action::Place::Goal MoveGroupInterface::constructPlaceGoal(
//    const std::string& object, std::vector<moveit_msgs::msg::PlaceLocation> locations, bool plan_only = false) const


[ planning_interface ](http://wiki.ros.org/planning_interface)
Author(s): Ioan Sucan  autogenerated on Wed Jul 10 2019 04:04:11


[ 81
](classmoveit_1_1planning__interface_1_1MoveItErrorCode.html#ad7c12c18bec22efc4271b565950a3803)
bool  [ operator==
](classmoveit_1_1planning__interface_1_1MoveItErrorCode.html#ad7c12c18bec22efc4271b565950a3803)
(  const  int  c)  const


219  std::map<std::string, std::string> getPlannerParams(  const  std::string&
planner_id,  const  std::string& group =  ""  );


bool
moveit::planning_interface::MoveGroupInterface::setApproximateJointValueTarget
|  (  |  const geometry_msgs::PoseStamped & |  _eef_pose_ ,
---|---|---|---
|  |  const std::string & |  _end_effector_link_ = ` "" `
|  )  |  |

Set the joint state goal for a particular joint by computing IK.


686  [ MoveItErrorCode
](classmoveit_1_1planning__interface_1_1MoveItErrorCode.html) asyncMove();


481  bool  setApproximateJointValueTarget(  const  Eigen::Affine3d& eef_pose,
const  std::string& end_effector_link =  ""  );


Definition at line [ 1795 ](move__group__interface_8cpp_source.html#l01795) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


double planning_time_


bool
moveit::planning_interface::MoveGroupInterface::setApproximateJointValueTarget
|  (  |  const [ geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
& |  _eef_pose_ ,
---|---|---|---
|  |  const std::string & |  _end_effector_link_ = ` "" `
|  )  |  |

Set the joint state goal for a particular joint by computing IK.


300  void  setStartState(  const  robot_state::RobotState& start_state);


    auto send_goal_opts = rclcpp_action::Client<moveit_msgs::action::MoveGroup>::SendGoalOptions();
    send_goal_opts.goal_response_callback =
        [&](const rclcpp_action::ClientGoalHandle<moveit_msgs::action::MoveGroup>::SharedPtr& goal_handle) {
          if (!goal_handle)
          {
            done = true;
            RCLCPP_INFO(logger_, "Plan and Execute request rejected");
          }
          else
            RCLCPP_INFO(logger_, "Plan and Execute request accepted");
        };
    send_goal_opts.result_callback =
        [&](const rclcpp_action::ClientGoalHandle<moveit_msgs::action::MoveGroup>::WrappedResult& result) {
          res = result.result;
          code = result.code;
          done = true;
          switch (result.code)
          {
            case rclcpp_action::ResultCode::SUCCEEDED:
              RCLCPP_INFO(logger_, "Plan and Execute request complete!");
              break;
            case rclcpp_action::ResultCode::ABORTED:
              RCLCPP_INFO(logger_, "Plan and Execute request aborted");
              return;
            case rclcpp_action::ResultCode::CANCELED:
              RCLCPP_INFO(logger_, "Plan and Execute request canceled");
              return;
            default:
              RCLCPP_INFO(logger_, "Plan and Execute request unknown result code");
              return;
          }
        };
    auto goal_handle_future = move_action_client_->async_send_goal(goal, send_goal_opts);
    if (!wait)
      return moveit::core::MoveItErrorCode::SUCCESS;
    // wait until send_goal_opts.result_callback is called
    while (!done)
    {
      std::this_thread::sleep_for(std::chrono::milliseconds(1));
    }


70  {


This always sets all of the group's joint values.


When planning, the planner will find a path to one (arbitrarily chosen) pose
from the list. If this group contains multiple end effectors then all end
effectors in the group should have the same number of pose targets. If
planning is successful then the result of the plan will place all end
effectors at a pose from the same index in the list. (In other words, if one
end effector ends up at the 3rd pose in the list then all end effectors in the
group will end up at the 3rd pose in their respective lists. End effectors
which do not matter (i.e. can end up in any position) can have their pose
targets disabled by calling [ clearPoseTarget()
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a837dd04d54218876236da957faf82374
"Forget pose\(s\) specified for end_effector_link. ") for that
end_effector_link.


MoveItErrorCode(const moveit_msgs::MoveItErrorCodes &code)


This applies a number of hard-coded default grasps


**Definition:** [ move_group_interface.h:81
](move__group__interface_8h_source.html#l00081)


    visual_tools.deleteAllMarkers();
    visual_tools.publishAxisLabeled(start_pose2, "start");
    visual_tools.publishAxisLabeled(target_pose1, "goal");
    visual_tools.publishText(text_pose, "Constrained Goal", rvt::WHITE, rvt::XLARGE);
    visual_tools.publishTrajectoryLine(my_plan.trajectory_, joint_model_group);
    visual_tools.trigger();
    visual_tools.prompt("next step");


Definition at line [ 1536 ](move__group__interface_8cpp_source.html#l01536) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


collision_object.id = "box1";


19  * contributors may be used to endorse or promote products derived


[ Go to the documentation of this file. ](move__group__interface_8h.html)


99  {


46  #include <moveit_msgs/PlannerInterfaceDescription.h>


188  robot_model::RobotModelConstPtr getRobotModel()  const  ;


moveit_msgs::TrajectoryConstraints
moveit::planning_interface::MoveGroupInterface::getTrajectoryConstraints  |  (
|  |  )  |  const
---|---|---|---|---

Definition at line [ 2225 ](move__group__interface_8cpp_source.html#l02225) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


71  val = code;


bool moveit::planning_interface::MoveGroupInterface::setPathConstraints  |  (
|  const std::string & |  _constraint_ |  )  |
---|---|---|---|---|---

Specify a set of path constraints to use. The constraints are looked up by
name from the Mongo database server. This replaces any path constraints set in
previous calls to [ setPathConstraints()
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#ac74ec94967a06f6b1da8ea6e060b7444
"Specify a set of path constraints to use. The constraints are looked up by
name from the Mongo databa...") .


78  {


[ moveit::planning_interface::MoveGroupInterface::MoveGroupInterfaceImpl
](classmoveit_1_1planning__interface_1_1MoveGroupInterface_1_1MoveGroupInterfaceImpl.html)


The target for all joints in the group are set to the value in _robot_state_ .


roslaunch moveit_tutorials move_group_interface_tutorial.launch


Now, let’s remove the objects from the world.


405  bool  setJointValueTarget(  const  sensor_msgs::JointState& state);


If _end_effector_link_ is empty then [ getEndEffectorLink()
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#aa329d5256a3fdf52911f2bdcfe3e31bc
"Get the current end-effector link. This returns the value set by
setEndEffectorLink\(\) \(or indirectly ...") is used.


[ 117
](structmoveit_1_1planning__interface_1_1MoveGroupInterface_1_1Options.html#a6d808c8691c7bb9f96ea7c586046b439)
std::string [ robot_description_
](structmoveit_1_1planning__interface_1_1MoveGroupInterface_1_1Options.html#a6d808c8691c7bb9f96ea7c586046b439)
;


Definition at line [ 1906 ](move__group__interface_8cpp_source.html#l01906) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


If you do not want to inspect the planned trajectory, the following is a more
robust combination of the two-step plan+execute pattern shown above and should
be preferred. Note that the pose goal we had set earlier is still active, so
the robot will try to move to that goal.


specified, and there is only one attached object, that object is detached. An
error is produced if no object to detach is identified.  More...

Query current robot state

bool  |  [ startStateMonitor
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#ae9996710a32f8636c1bb82750929dca8)
(double [ wait
](../../../api/class_loader/html/utest_8cpp.html#a187b797b1f9cdadccdffa80aed68c440)
=1.0)
|  When reasoning about the current state of a robot, a CurrentStateMonitor
instance is automatically constructed. This function allows triggering the
construction of that object from the beginning, so that future calls to
functions such as [ getCurrentState()
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#aecbc1f0926edc654375c9125dbb2a16d
"Get the current state of the robot within the duration specified by wait. ")
will not take so long and are less likely to fail.  More...

std::vector< double > |  [ getCurrentJointValues
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a83676c1aca54429ff0de9919ffb79b7a)
()
|  Get the current joint values for the joints planned for by this instance
(see [ getJoints()
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#ad70dc7e2c5554d63d66fb9ccf1bfa36c
"Get all the joints this instance operates on \(including fixed joints\) ") )
More...

robot_state::RobotStatePtr  |  [ getCurrentState
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#aecbc1f0926edc654375c9125dbb2a16d)
(double [ wait
](../../../api/class_loader/html/utest_8cpp.html#a187b797b1f9cdadccdffa80aed68c440)
=1)
|  Get the current state of the robot within the duration specified by wait.
More...

geometry_msgs::PoseStamped  |  [ getCurrentPose
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a6430022f7709b989857af33b1a128563)
(const std::string &end_effector_link="")
|  Get the pose for the end-effector _end_effector_link_ . If


[ actionlib::SimpleActionClient
](../../../api/actionlib/html/classactionlib_1_1SimpleActionClient.html) <
moveit_msgs::MoveGroupAction > &
moveit::planning_interface::MoveGroupInterface::getMoveGroupClient  |  (  |  |
)  |  const
---|---|---|---|---

Get the [ move_group
](../../../api/moveit_ros_manipulation/html/namespacemove__group.html) action
client used by the _[ MoveGroupInterface
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html "Client class
to conveniently use the ROS interfaces provided by the move_group node. ") _ .
The client can be used for querying the execution state of the trajectory and
abort trajectory execution during asynchronous execution.


  //    goal.possible_grasps = std::move(grasps);
  //    if (!support_surface_.empty())
  //      goal.allow_gripper_support_collision = true;
  //
  //    if (path_constraints_)
  //      goal.path_constraints = *path_constraints_;
  //
  //    goal.planner_id = planner_id_;
  //    goal.allowed_planning_time = allowed_planning_time_;
  //
  //    goal.planning_options.plan_only = plan_only;
  //    goal.planning_options.look_around = can_look_;
  //    goal.planning_options.replan = can_replan_;
  //    goal.planning_options.replan_delay = replan_delay_;
  //    goal.planning_options.planning_scene_diff.is_diff = true;
  //    goal.planning_options.planning_scene_diff.robot_state.is_diff = true;
  //    return goal;
  //  }
  //  moveit_msgs::action::Place::Goal constructPlaceGoal(const std::string& object,
  //                                                    std::vector<moveit_msgs::msg::PlaceLocation>&& locations,
  //                                                    bool plan_only = false) const
  //  {
  //    moveit_msgs::action::Place::Goal goal;
  //    goal.group_name = opt_.group_name;
  //    goal.attached_object_name = object;
  //    goal.support_surface_name = support_surface_;
  //    goal.place_locations = std::move(locations);
  //    if (!support_surface_.empty())
  //      goal.allow_gripper_support_collision = true;
  //
  //    if (path_constraints_)
  //      goal.path_constraints = *path_constraints_;
  //
  //    goal.planner_id = planner_id_;
  //    goal.allowed_planning_time = allowed_planning_time_;
  //
  //    goal.planning_options.plan_only = plan_only;
  //    goal.planning_options.look_around = can_look_;
  //    goal.planning_options.replan = can_replan_;
  //    goal.planning_options.replan_delay = replan_delay_;


25  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE


Inheritance diagram for moveit::planning_interface::MoveGroupInterface:


253  void  setMaxAccelerationScalingFactor(  double
max_acceleration_scaling_factor);


void moveit::planning_interface::MoveGroupInterface::setStartState  |  (  |
const robot_state::RobotState & |  _start_state_ |  )  |
---|---|---|---|---|---

If a different start state should be considered instead of the current state
of the robot, this function sets that state.


822  bool  detachObject(  const  std::string& name =  ""  );


720  moveit_msgs::RobotTrajectory& trajectory,  bool  avoid_collisions =  true
,


[ moveit::planning_interface::MoveGroupInterface::Options::node_handle_
](structmoveit_1_1planning__interface_1_1MoveGroupInterface_1_1Options.html#a4d5aa2c0acde1db173173f4878ee3e27)


**Definition:** [ movegroup_interface.py:5
](movegroup__interface_8py_source.html#l00005)


27  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,


[ moveit::planning_interface::MoveItErrorCode::MoveItErrorCode
](classmoveit_1_1planning__interface_1_1MoveItErrorCode.html#af155da6133976a737823585a12b6aaf6)


bool moveit::planning_interface::MoveGroupInterface::getInterfaceDescription
|  (  |  moveit_msgs::PlannerInterfaceDescription & |  _desc_ |  )  |
---|---|---|---|---|---

Get the description of the planning plugin loaded by the action server.


MoveItErrorCode(int code)


#include <moveit/warehouse/constraints_storage.h>
#include <moveit/kinematic_constraints/utils.h>
#include <moveit/move_group/capability_names.h>
#include <moveit/move_group_interface/move_group_interface.h>
#include <moveit/planning_scene_monitor/current_state_monitor.h>
#include <moveit/planning_scene_monitor/planning_scene_monitor.h>
#include <moveit/planning_scene_interface/planning_scene_interface.h>
#include <moveit/trajectory_execution_manager/trajectory_execution_manager.h>
#include <moveit/common_planning_interface_objects/common_objects.h>
#include <moveit/robot_state/conversions.h>
#include <moveit_msgs/action/execute_trajectory.hpp>
#include <moveit_msgs/srv/query_planner_interfaces.hpp>
#include <moveit_msgs/srv/get_cartesian_path.hpp>
#include <moveit_msgs/srv/grasp_planning.hpp>
#include <moveit_msgs/srv/get_planner_params.hpp>
#include <moveit_msgs/srv/set_planner_params.hpp>
#include <moveit/utils/rclcpp_utils.h>
#include <moveit/utils/logger.hpp>
#include <std_msgs/msg/string.hpp>
#include <geometry_msgs/msg/transform_stamped.hpp>
#include <tf2/utils.h>
#include <tf2_eigen/tf2_eigen.hpp>
#include <tf2_ros/transform_listener.h>
#include <rclcpp/rclcpp.hpp>
#include <rclcpp/version.h>
namespace moveit
{
namespace planning_interface
{
const std::string MoveGroupInterface::ROBOT_DESCRIPTION =
    "robot_description";  // name of the robot description (a param name, so it can be changed externally)
const std::string GRASP_PLANNING_SERVICE_NAME = "plan_grasps";  // name of the service that can be used to plan grasps
namespace
{
enum ActiveTargetType
{
  JOINT,
  POSE,
  POSITION,
  ORIENTATION


Definition at line [ 2241 ](move__group__interface_8cpp_source.html#l02241) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


plan_only=false)
|  Pick up an object given a grasp pose.  More...

[ MoveItErrorCode
](classmoveit_1_1planning__interface_1_1MoveItErrorCode.html) |  [ pick
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a5282b9d12418b751f84cbff0a021a8ae)
(const std::string &object, const std::vector< moveit_msgs::Grasp > &grasps,
bool plan_only=false)
|  Pick up an object given possible grasp poses.  More...

[ MoveItErrorCode
](classmoveit_1_1planning__interface_1_1MoveItErrorCode.html) |  [
planGraspsAndPick
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#ab55194dc7ccb62c50a1a0d6d653f43bd)
(const std::string &object="", bool plan_only=false)
|  Pick up an object.  More...

[ MoveItErrorCode
](classmoveit_1_1planning__interface_1_1MoveItErrorCode.html) |  [
planGraspsAndPick
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a8dd2aaa5eba418be6bb75bf92fd4a5ea)
(const moveit_msgs::CollisionObject &object, bool plan_only=false)
|  Pick up an object.  More...

[ MoveItErrorCode
](classmoveit_1_1planning__interface_1_1MoveItErrorCode.html) |  [ place
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a08cb62ef4aed345c37c61500567246f5)
(const std::string &object, bool plan_only=false)
|  Place an object somewhere safe in the world (a safe location will be
detected)  More...

[ MoveItErrorCode
](classmoveit_1_1planning__interface_1_1MoveItErrorCode.html) |  [ place
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a9aa35d793087769f89eca1316d893601)
(const std::string &object, const std::vector< moveit_msgs::PlaceLocation >
&locations, bool plan_only=false)
|  Place an object at one of the specified possible locations.  More...

[ MoveItErrorCode
](classmoveit_1_1planning__interface_1_1MoveItErrorCode.html) |  [ place


[ 114
](structmoveit_1_1planning__interface_1_1MoveGroupInterface_1_1Options.html#a2cf3354acfc47c1708dd511be0bca347)
std::string [ group_name_
](structmoveit_1_1planning__interface_1_1MoveGroupInterface_1_1Options.html#a2cf3354acfc47c1708dd511be0bca347)
;


We can also print the name of the end-effector link for this group.


764  [ MoveItErrorCode
](classmoveit_1_1planning__interface_1_1MoveItErrorCode.html) pick(  const
std::string& object  ,  bool  plan_only =  false  );


**Definition:** [ move_group_interface.h:98
](move__group__interface_8h_source.html#l00098)


bool moveit::planning_interface::MoveGroupInterface::setOrientationTarget  |
(  |  double  |  _x_ ,
---|---|---|---
|  |  double  |  _y_ ,
|  |  double  |  _z_ ,
|  |  double  |  _w_ ,
|  |  const std::string & |  _end_effector_link_ = ` "" `
|  )  |  |

Set the goal orientation of the end-effector _end_effector_link_ to be the
quaternion ( _x_ , _y_ , _z_ , _w_ ).


[ 98 ](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html) class  [
MoveGroupInterface
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html)


We will use the [ PlanningSceneInterface
](http://docs.ros.org/noetic/api/moveit_ros_planning_interface/html/classmoveit_1_1planning__interface_1_1PlanningSceneInterface.html)
class to add and remove collision objects in our “virtual world” scene


[ 62 ](classmoveit_1_1planning__interface_1_1MoveItErrorCode.html) class  [
MoveItErrorCode ](classmoveit_1_1planning__interface_1_1MoveItErrorCode.html)
:  public  moveit_msgs::MoveItErrorCodes


737  const  moveit_msgs::Constraints& path_constraints,  bool
avoid_collisions =  true  ,


bool moveit::planning_interface::MoveGroupInterface::setJointValueTarget  |  (
|  const [ geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
& |  _eef_pose_ ,
---|---|---|---
|  |  const std::string & |  _end_effector_link_ = ` "" `
|  )  |  |

Set the joint state goal for a particular joint by computing IK.


After this call, the JointValueTarget is used **instead** of any previously
set Position, Orientation, or Pose targets.


roslaunch panda_moveit_config demo.launch


**Definition:** [ move_group_interface.h:85
](move__group__interface_8h_source.html#l00085)


638  void  clearPoseTarget(  const  std::string& end_effector_link =  ""  );


Definition at line [ 1525 ](move__group__interface_8cpp_source.html#l01525) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


[ moveit::planning_interface::MoveItErrorCode
](classmoveit_1_1planning__interface_1_1MoveItErrorCode.html)
moveit::planning_interface::MoveGroupInterface::asyncMove  |  (  |  |  )  |
---|---|---|---|---

[ Plan
](structmoveit_1_1planning__interface_1_1MoveGroupInterface_1_1Plan.html "The
representation of a motion plan \(as ROS messasges\) ") and execute a
trajectory that takes the group of joints declared in the constructor to the
specified target. This call is not blocking (does not wait for the execution
of the trajectory to complete).


Definition at line [ 1979 ](move__group__interface_8cpp_source.html#l01979) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


bool moveit::planning_interface::MoveGroupInterface::setJointValueTarget  |  (
|  const Eigen::Affine3d & |  _eef_pose_ ,
---|---|---|---
|  |  const std::string & |  _end_effector_link_ = ` "" `
|  )  |  |

Set the joint state goal for a particular joint by computing IK.


##  Member Data Documentation


8  * Redistribution and use in source and binary forms, with or without


![animation showing the arm moving differently once the object is
attached](../../_images/move_group_interface_tutorial_attached_object.gif)


Definition at line [ 1650 ](move__group__interface_8cpp_source.html#l01650) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


` #include < [ move_group_interface.h ](move__group__interface_8h_source.html)
> `


920  void  clearPathConstraints();


If _end_effector_link_ is empty then [ getEndEffectorLink()
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#aa329d5256a3fdf52911f2bdcfe3e31bc
"Get the current end-effector link. This returns the value set by
setEndEffectorLink\(\) \(or indirectly ...") is used.


1  /*********************************************************************


Definition at line [ 1520 ](move__group__interface_8cpp_source.html#l01520) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


  * [ Debugging Tests ](../test_debugging/test_debugging_tutorial.html)
    * [ Getting Started ](../test_debugging/test_debugging_tutorial.html#getting-started)
    * [ CI Failures ](../test_debugging/test_debugging_tutorial.html#ci-failures)
    * [ Launch Docker Environment ](../test_debugging/test_debugging_tutorial.html#launch-docker-environment)
    * [ Setup Environment ](../test_debugging/test_debugging_tutorial.html#setup-environment)
    * [ Checkout Code ](../test_debugging/test_debugging_tutorial.html#checkout-code)
    * [ Install Dependencies ](../test_debugging/test_debugging_tutorial.html#install-dependencies)
    * [ Configure and Build ](../test_debugging/test_debugging_tutorial.html#configure-and-build)
    * [ Build the Tests ](../test_debugging/test_debugging_tutorial.html#build-the-tests)
    * [ Run the Tests ](../test_debugging/test_debugging_tutorial.html#run-the-tests)
    * [ Run One Test ](../test_debugging/test_debugging_tutorial.html#run-one-test)


const std::string &
moveit::planning_interface::MoveGroupInterface::getPlannerId  |  (  |  |  )  |
const
---|---|---|---|---

Get the current planner_id.


Let’s set a joint space goal and move towards it. This will replace the pose
target we set above.


  * [ Class List  ](annotated.html)
  * [ Class Hierarchy  ](inherits.html)
  * [ Class Members  ](functions.html)


    target = getPoseTarget(end_effector_link);
    transformPose(*impl_->getTF(), impl_->getPoseReferenceFrame(), target);
  }
  else
  {
    target.pose.position.x = 0.0;
    target.pose.position.y = 0.0;
    target.pose.position.z = 0.0;
    target.header.frame_id = impl_->getPoseReferenceFrame();
  }
  tf2::Quaternion q;
  q.setRPY(r, p, y);
  target.pose.orientation = tf2::toMsg(q);
  bool result = setPoseTarget(target, end_effector_link);
  impl_->setTargetType(ORIENTATION);
  return result;
}
bool MoveGroupInterface::setOrientationTarget(double x, double y, double z, double w,
                                              const std::string& end_effector_link)
{
  geometry_msgs::msg::PoseStamped target;
  if (impl_->hasPoseTarget(end_effector_link))
  {
    target = getPoseTarget(end_effector_link);
    transformPose(*impl_->getTF(), impl_->getPoseReferenceFrame(), target);
  }
  else
  {
    target.pose.position.x = 0.0;
    target.pose.position.y = 0.0;
    target.pose.position.z = 0.0;
    target.header.frame_id = impl_->getPoseReferenceFrame();
  }
  target.pose.orientation.x = x;
  target.pose.orientation.y = y;
  target.pose.orientation.z = z;
  target.pose.orientation.w = w;
  bool result = setPoseTarget(target, end_effector_link);
  impl_->setTargetType(ORIENTATION);
  return result;


###  Getting Basic Information  ¶


void moveit::planning_interface::MoveGroupInterface::setPoseReferenceFrame  |
(  |  const std::string & |  _pose_reference_frame_ |  )  |
---|---|---|---|---|---

Specify which reference frame to assume for poses specified without a
reference frame.


Definition at line [ 1447 ](move__group__interface_8cpp_source.html#l01447) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


39  #define MOVEIT_MOVE_GROUP_INTERFACE_MOVE_GROUP_INTERFACE_


[ execute
](../../../api/roscpp/html/namespaceros_1_1master.html#a6148ee923ef1602d2093daff82573043)


void moveit::planning_interface::MoveGroupInterface::setStartState  |  (  |
const moveit_msgs::RobotState & |  _start_state_ |  )  |
---|---|---|---|---|---

If a different start state should be considered instead of the current state
of the robot, this function sets that state.


After this call, the JointValueTarget is used **instead** of any previously
set Position, Orientation, or Pose targets.


842  robot_state::RobotStatePtr getCurrentState(  double  wait = 1);


"Specify the name of the end-effector to use. This is equivalent to setting
the EndEffectorLink to the...") ). If [ setEndEffectorLink()
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a344d714020cfbbfed36ccf7b3c5055da
"Specify the parent link of the end-effector. This end_effector_link will be
used in calls to pose tar...") was not called, this function reports the link
name that serves as parent of an end-effector attached to this group. If there
are multiple end-effectors, one of them is returned. If no such link is known,
the empty string is returned.  More...

const std::string & |  [ getEndEffector
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a308ce78d3f36f05f3fbb6f582ee9ede6)
() const
|  Get the current end-effector name. This returns the value set by [
setEndEffector()
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#acd09831014016b69fef201a066560184
"Specify the name of the end-effector to use. This is equivalent to setting
the EndEffectorLink to the...") (or indirectly by [ setEndEffectorLink()
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a344d714020cfbbfed36ccf7b3c5055da
"Specify the parent link of the end-effector. This end_effector_link will be
used in calls to pose tar...") ). If [ setEndEffector()
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#acd09831014016b69fef201a066560184
"Specify the name of the end-effector to use. This is equivalent to setting
the EndEffectorLink to the...") was not called, this function reports an end-
effector attached to this group. If there are multiple end-effectors, one of
them is returned. If no end-effector is known, the empty string is returned.
More...

const std::string & |  [ getPoseReferenceFrame
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a3488deaa8569fa3e86f3d99f2ef72e7e)
() const
|  Get the reference frame set by [ setPoseReferenceFrame()
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#aac4b6f7cb3c3257001ccbd64c6d14f46
"Specify which reference frame to assume for poses specified without a
reference frame. ") . By default this is the reference frame of the robot
model.  More...

Planning a path from the start position to the Target (goal) position, and
executing that plan.


815  bool  [ attachObject ](demo_8cpp.html#a7b9e3632e33ade1fb91f781cf2a349b8)
(  const  std::string& object  ,  const  std::string& link,  const
std::vector<std::string>& touch_links);


Definition at line [ 1847 ](move__group__interface_8cpp_source.html#l01847) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


The package MoveItVisualTools provides many capabilities for visualizing
objects, robots, and trajectories in RViz as well as debugging tools such as
step-by-step introspection of a script.


If IK fails to find a solution then an approximation is used.


bool operator!=(const int c) const


932  };


std::string
moveit::planning_interface::MoveGroupInterface::getDefaultPlannerId  |  (  |
const std::string & |  _group_ = ` "" ` |  )  |  const
---|---|---|---|---|---

Get the default planner for a given group (or global default)


Definition at line [ 1583 ](move__group__interface_8cpp_source.html#l01583) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


Now, set it as the path constraint for the group.


Watch this quick [ YouTube video demo ](https://youtu.be/_5siHkFQPBQ) to see
the power of the move group interface!


Definition at line [ 1884 ](move__group__interface_8cpp_source.html#l01884) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


    visual_tools.deleteAllMarkers();
    visual_tools.publishText(text_pose, "Cartesian Path", rvt::WHITE, rvt::XLARGE);
    visual_tools.publishTrajectoryLine(trajectory, joint_model_group);
    visual_tools.publishPath(waypoints, rvt::LIME_GREEN, rvt::SMALL);
    for (std::size_t i = 0; i < waypoints.size(); ++i)
      visual_tools.publishAxisLabeled(waypoints[i], "pt" + std::to_string(i), rvt::SMALL);
    visual_tools.trigger();
    visual_tools.prompt("Press 'next' in the RvizVisualToolsGui window to continue the demo");


[ 134
](structmoveit_1_1planning__interface_1_1MoveGroupInterface_1_1Plan.html#af974e387daa3c09c4e19f29657a2b7cb)
moveit_msgs::RobotTrajectory [ trajectory_
](structmoveit_1_1planning__interface_1_1MoveGroupInterface_1_1Plan.html#af974e387daa3c09c4e19f29657a2b7cb)
;


150  const  [ boost::shared_ptr<tf::Transformer>
](../../../api/roscpp_traits/html/classboost_1_1shared__ptr.html) & [ tf
](../../../api/eigen_conversions/html/namespacetf.html) = [
boost::shared_ptr<tf::Transformer>
](../../../api/roscpp_traits/html/classboost_1_1shared__ptr.html) (),


847  geometry_msgs::PoseStamped getCurrentPose(  const  std::string&
end_effector_link =  ""  );


Specification of options to use when constructing the MoveGroupInterface
class.


Now when we plan a trajectory it will avoid the obstacle


moveit_msgs::RobotTrajectory trajectory_


(const std::string &joint_name, double value)
|  Set the JointValueTarget and use it for future planning requests.  More...

bool  |  [ setJointValueTarget
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#adc5bab02c10ad2ae1ee83215b66d52b7)
(const sensor_msgs::JointState &state)
|  Set the JointValueTarget and use it for future planning requests.  More...

bool  |  [ setJointValueTarget
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#ab654cb8e9f1e3c3f772a4b60bb80ce25)
(const [ geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
&eef_pose, const std::string &end_effector_link="")
|  Set the joint state goal for a particular joint by computing IK.  More...

bool  |  [ setJointValueTarget
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#af21679db6e03559a27d63d086614e360)
(const geometry_msgs::PoseStamped &eef_pose, const std::string
&end_effector_link="")
|  Set the joint state goal for a particular joint by computing IK.  More...

bool  |  [ setJointValueTarget
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#aba8d138252ef2f85f1b74c7a40739a4d)
(const Eigen::Affine3d &eef_pose, const std::string &end_effector_link="")
|  Set the joint state goal for a particular joint by computing IK.  More...

bool  |  [ setApproximateJointValueTarget
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a1e7e2b8f5dd5e2f97ee936015b9338bb)
(const [ geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
&eef_pose, const std::string &end_effector_link="")
|  Set the joint state goal for a particular joint by computing IK.  More...

bool  |  [ setApproximateJointValueTarget
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a4322570daae71478f283872abf3dde93)
(const geometry_msgs::PoseStamped &eef_pose, const std::string
&end_effector_link="")
|  Set the joint state goal for a particular joint by computing IK.  More...

bool  |  [ setApproximateJointValueTarget


545  bool  setPoseTarget(  const  Eigen::Affine3d& end_effector_pose,  const
std::string& end_effector_link =  ""  );


Definition at line [ 1458 ](move__group__interface_8cpp_source.html#l01458) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


bool moveit::planning_interface::MoveGroupInterface::setJointValueTarget  |  (
|  const robot_state::RobotState & |  _robot_state_ |  )  |
---|---|---|---|---|---

Set the JointValueTarget and use it for future planning requests.


Definition at line [ 2279 ](move__group__interface_8cpp_source.html#l02279) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


3  *


Definition at line [ 131 ](move__group__interface_8h_source.html#l00131) of
file [ move_group_interface.h ](move__group__interface_8h_source.html) .


Definition at line [ 1777 ](move__group__interface_8cpp_source.html#l01777) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


Definition at line [ 1472 ](move__group__interface_8cpp_source.html#l01472) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


256  double  getPlanningTime()  const  ;


    ROS_INFO_NAMED("tutorial", "Remove the objects from the world");
    std::vector<std::string> object_ids;
    object_ids.push_back(collision_object.id);
    object_ids.push_back(object_to_attach.id);
    planning_scene_interface.removeCollisionObjects(object_ids);


68  }


Definition at line [ 1695 ](move__group__interface_8cpp_source.html#l01695) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


28  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;


83  return  val == c;


std::vector< double >
moveit::planning_interface::MoveGroupInterface::getRandomJointValues  |  (  |
|  )  |
---|---|---|---|---

Get random joint values for the joints planned for by this instance (see [
getJoints()
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#ad70dc7e2c5554d63d66fb9ccf1bfa36c
"Get all the joints this instance operates on \(including fixed joints\) ") )


bool moveit::planning_interface::MoveGroupInterface::setEndEffector  |  (  |
const std::string & |  _eef_name_ |  )  |
---|---|---|---|---|---

Specify the name of the end-effector to use. This is equivalent to setting the
EndEffectorLink to the parent link of this end effector.


###  Adding objects to the environment  ¶


Definition at line [ 1559 ](move__group__interface_8cpp_source.html#l01559) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


[ 77
](classmoveit_1_1planning__interface_1_1MoveItErrorCode.html#ac6b141036599f1675ee8b4079adc36c5)
explicit  operator  bool()  const


6  * All rights reserved.


[ moveit::planning_interface::MOVEIT_CLASS_FORWARD
](namespacemoveit_1_1planning__interface.html#a6e3731ab08afb210c97f7d8400ccb8b6)


Joint _joint_name_ must be a 1-DOF joint. _value_ is set as the target for
this joint. Other joint targets remain unchanged.


If these values are out of bounds then false is returned BUT THE VALUES ARE
STILL SET AS THE GOAL.


152  [ MOVEIT_DEPRECATED
](namespacemoveit_1_1planning__interface.html#a706399608538b81b2936e34817260537)
[ MoveGroupInterface
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html) (  const  [
Options
](structmoveit_1_1planning__interface_1_1MoveGroupInterface_1_1Options.html) &
opt,  const  [ boost::shared_ptr<tf::Transformer>
](../../../api/roscpp_traits/html/classboost_1_1shared__ptr.html) & [ tf
](../../../api/eigen_conversions/html/namespacetf.html) ,


Now, let’s detach the cylinder from the robot’s gripper.


std::vector< double >
moveit::planning_interface::MoveGroupInterface::getCurrentJointValues  |  (  |
|  )  |
---|---|---|---|---

Get the current joint values for the joints planned for by this instance (see
[ getJoints()
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#ad70dc7e2c5554d63d66fb9ccf1bfa36c
"Get all the joints this instance operates on \(including fixed joints\) ") )


              return;
            case rclcpp_action::ResultCode::CANCELED:
              RCLCPP_INFO(logger_, "Execute request canceled");
              return;
            default:
              RCLCPP_INFO(logger_, "Execute request unknown result code");
              return;
          }
        };
    moveit_msgs::action::ExecuteTrajectory::Goal goal;
    goal.trajectory = trajectory;
    goal.controller_names = controllers;
    auto goal_handle_future = execute_action_client_->async_send_goal(goal, send_goal_opts);
    if (!wait)
      return moveit::core::MoveItErrorCode::SUCCESS;
    // wait until send_goal_opts.result_callback is called
    while (!done)
    {
      std::this_thread::sleep_for(std::chrono::milliseconds(1));
    }
    if (code != rclcpp_action::ResultCode::SUCCEEDED)
    {
      RCLCPP_ERROR_STREAM(logger_, "MoveGroupInterface::execute() failed or timeout reached");
    }
    return res->error_code;
  }
  double computeCartesianPath(const std::vector<geometry_msgs::msg::Pose>& waypoints, double step,
                              double jump_threshold, moveit_msgs::msg::RobotTrajectory& msg,
                              const moveit_msgs::msg::Constraints& path_constraints, bool avoid_collisions,
                              moveit_msgs::msg::MoveItErrorCodes& error_code)
  {
    auto req = std::make_shared<moveit_msgs::srv::GetCartesianPath::Request>();
    moveit_msgs::srv::GetCartesianPath::Response::SharedPtr response;
    if (considered_start_state_)
    {
      moveit::core::robotStateToRobotStateMsg(*considered_start_state_, req->start_state);
    }
    else
    {
      req->start_state.is_diff = true;


[ Next
](../move_group_python_interface/move_group_python_interface_tutorial.html
"Move Group Python Interface") [ Previous
](../quickstart_in_rviz/quickstart_in_rviz_tutorial.html "MoveIt Quickstart in
RViz")


232  const  std::string& getPlannerId()  const  ;


Definition at line [ 137 ](move__group__interface_8h_source.html#l00137) of
file [ move_group_interface.h ](move__group__interface_8h_source.html) .


**Definition:** [ move_group_interface.h:882
](move__group__interface_8h_source.html#l00882)


reference frame.  More...

bool  |  [ setEndEffectorLink
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a344d714020cfbbfed36ccf7b3c5055da)
(const std::string &end_effector_link)
|  Specify the parent link of the end-effector. This _end_effector_link_ will
be used in calls to pose target functions when end_effector_link is not
explicitly specified.  More...

bool  |  [ setEndEffector
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#acd09831014016b69fef201a066560184)
(const std::string &eef_name)
|  Specify the name of the end-effector to use. This is equivalent to setting
the EndEffectorLink to the parent link of this end effector.  More...

void  |  [ clearPoseTarget
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a837dd04d54218876236da957faf82374)
(const std::string &end_effector_link="")
|  Forget pose(s) specified for _end_effector_link_ .  More...

void  |  [ clearPoseTargets
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#aca31d1456dd7b6ef92b309a1b1922af0)
()
|  Forget any poses specified for all end-effectors.  More...

const geometry_msgs::PoseStamped & |  [ getPoseTarget
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a7ce866118312d6f2a9698ba015f0136b)
(const std::string &end_effector_link="") const
const std::vector< geometry_msgs::PoseStamped > & |  [ getPoseTargets
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#acca0012a0c21d3a68ae6b8080c3635a2)
(const std::string &end_effector_link="") const
const std::string & |  [ getEndEffectorLink
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#aa329d5256a3fdf52911f2bdcfe3e31bc)
() const
|  Get the current end-effector link. This returns the value set by [
setEndEffectorLink()
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a344d714020cfbbfed36ccf7b3c5055da
"Specify the parent link of the end-effector. This end_effector_link will be
used in calls to pose tar...") (or indirectly by [ setEndEffector()
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#acd09831014016b69fef201a066560184


    if (jt != pose_targets_.end())
    {
      if (!jt->second.empty())
        return jt->second.at(0);
    }
    // or return an error
    static const geometry_msgs::msg::PoseStamped UNKNOWN;
    RCLCPP_ERROR(logger_, "Pose for end-effector '%s' not known.", eef.c_str());
    return UNKNOWN;
  }
  const std::vector<geometry_msgs::msg::PoseStamped>& getPoseTargets(const std::string& end_effector_link) const
  {
    const std::string& eef = end_effector_link.empty() ? end_effector_link_ : end_effector_link;
    std::map<std::string, std::vector<geometry_msgs::msg::PoseStamped>>::const_iterator jt = pose_targets_.find(eef);
    if (jt != pose_targets_.end())
    {
      if (!jt->second.empty())
        return jt->second;
    }
    // or return an error
    static const std::vector<geometry_msgs::msg::PoseStamped> EMPTY;
    RCLCPP_ERROR(logger_, "Poses for end-effector '%s' are not known.", eef.c_str());
    return EMPTY;
  }
  void setPoseReferenceFrame(const std::string& pose_reference_frame)
  {
    pose_reference_frame_ = pose_reference_frame;
  }
  void setSupportSurfaceName(const std::string& support_surface)
  {
    support_surface_ = support_surface;
  }
  const std::string& getPoseReferenceFrame() const
  {
    return pose_reference_frame_;
  }
  void setTargetType(ActiveTargetType type)
  {
    active_target_ = type;
  }


std::string robot_description_


Definition at line [ 2015 ](move__group__interface_8cpp_source.html#l02015) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


Path constraints can easily be specified for a link on the robot. Let’s
specify a path constraint and a pose goal for our group. First define the path
constraint.


[ moveit::planning_interface::MOVEIT_DEPRECATED
](namespacemoveit_1_1planning__interface.html#a706399608538b81b2936e34817260537)


Definition at line [ 1509 ](move__group__interface_8cpp_source.html#l01509) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


bool moveit::planning_interface::MoveGroupInterface::setPoseTarget  |  (  |
const [ geometry_msgs::Pose
](../../../api/tf/html/c++/namespacetf.html#af31f272a1879787c24c3decb07cdb361)
& |  _target_ ,
---|---|---|---
|  |  const std::string & |  _end_effector_link_ = ` "" `
|  )  |  |

Set the goal pose of the end-effector _end_effector_link_ .


Definition at line [ 2162 ](move__group__interface_8cpp_source.html#l02162) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


std::map< std::string, std::string >
moveit::planning_interface::MoveGroupInterface::getPlannerParams  |  (  |
const std::string & |  _planner_id_ ,
---|---|---|---
|  |  const std::string & |  _group_ = ` "" `
|  )  |  |

Get the planner parameters for given group and planner_id.


34  *********************************************************************/


922  moveit_msgs::TrajectoryConstraints getTrajectoryConstraints()  const  ;


626  void  setPoseReferenceFrame(  const  std::string& pose_reference_frame);


_variable_values_ is a map of joint variable names to values. Joints in the
group are used to set the JointValueTarget. Joints in the model but not in the
group are ignored. An exception is thrown if a joint name is not found in the
model. Joint variables in the group that are missing from _variable_values_
remain unchanged (to reset all target variables to their current values in the
robot use setJointValueTarget(getCurrentJointValues())).


32  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE


    joint_group_positions[0] = -tau / 6;  // -1/6 turn in radians
    move_group_interface.setJointValueTarget(joint_group_positions);


Definition at line [ 2210 ](move__group__interface_8cpp_source.html#l02210) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


149  [ MoveGroupInterface
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html) (  const  [
Options
](structmoveit_1_1planning__interface_1_1MoveGroupInterface_1_1Options.html) &
opt,


If these values are out of bounds then false is returned BUT THE VALUES ARE
STILL SET AS THE GOAL.


20  * from this software without specific prior written permission.


[ moveit::planning_interface::MoveGroupInterface::Options::robot_model_
](structmoveit_1_1planning__interface_1_1MoveGroupInterface_1_1Options.html#a2e72f8b0daa9a9f7067648c9eca24b15)


We can get a list of all the groups in the robot:


###  Setup  ¶


444  bool  setJointValueTarget(  const  Eigen::Affine3d& eef_pose,  const
std::string& end_effector_link =  ""  );


Finally, to execute the trajectory stored in my_plan, you could use the
following method call: Note that this can lead to problems if the robot moved
in the meanwhile. move_group_interface.execute(my_plan);


  * [ Class List  ](annotated.html)
  * [ Class Hierarchy  ](inherits.html)
  * [ Class Members  ](functions.html)


Definition at line [ 2025 ](move__group__interface_8cpp_source.html#l02025) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


[ simple_action_client.h
](../../../api/actionlib/html/simple__action__client_8h.html)


933  }


Raw pointers are frequently used to refer to the planning group for improved
performance.


void attachObject(void)


88  }


By default planning requests with orientation path constraints are sampled in
` cartesian  space  ` so that invoking IK serves as a generative sampler.


[ moveit::planning_interface::MoveItErrorCode
](classmoveit_1_1planning__interface_1_1MoveItErrorCode.html)
moveit::planning_interface::MoveGroupInterface::move  |  (  |  |  )  |
---|---|---|---|---

[ Plan
](structmoveit_1_1planning__interface_1_1MoveGroupInterface_1_1Plan.html "The
representation of a motion plan \(as ROS messasges\) ") and execute a
trajectory that takes the group of joints declared in the constructor to the
specified target. This call is always blocking (waits for the execution of the
trajectory to complete) and requires an asynchronous spinner to be started.


Definition at line [ 2190 ](move__group__interface_8cpp_source.html#l02190) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


bool operator==(const int c) const


Definition at line [ 2047 ](move__group__interface_8cpp_source.html#l02047) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


const robot_state::RobotState &
moveit::planning_interface::MoveGroupInterface::getJointValueTarget  |  (  |
|  )  |  const
---|---|---|---|---

Get the currently set joint state goal.


Definition at line [ 2285 ](move__group__interface_8cpp_source.html#l02285) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


##  Getting Started  ¶


Definition at line [ 2264 ](move__group__interface_8cpp_source.html#l02264) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


void MoveGroupInterface::setStartStateToCurrentState()
{
  impl_->setStartStateToCurrentState();
}
void MoveGroupInterface::setRandomTarget()
{
  impl_->getTargetRobotState().setToRandomPositions();
  impl_->setTargetType(JOINT);
}
const std::vector<std::string>& MoveGroupInterface::getJointNames() const
{
  return impl_->getJointModelGroup()->getVariableNames();
}
const std::vector<std::string>& MoveGroupInterface::getLinkNames() const
{
  return impl_->getJointModelGroup()->getLinkModelNames();
}
std::map<std::string, double> MoveGroupInterface::getNamedTargetValues(const std::string& name) const
{
  std::map<std::string, std::vector<double>>::const_iterator it = remembered_joint_values_.find(name);
  std::map<std::string, double> positions;
  if (it != remembered_joint_values_.cend())
  {
    std::vector<std::string> names = impl_->getJointModelGroup()->getVariableNames();
    for (size_t x = 0; x < names.size(); ++x)
    {
      positions[names[x]] = it->second[x];
    }
  }
  else
  {
    if (!impl_->getJointModelGroup()->getVariableDefaultPositions(name, positions))
    {
      RCLCPP_ERROR(logger_, "The requested named target '%s' does not exist, returning empty positions.", name.c_str());
    }
  }
  return positions;
}
bool MoveGroupInterface::setNamedTarget(const std::string& name)
{


moveit::planning_interface::MoveGroupInterface::MoveGroupInterface  |  (  |  [
MoveGroupInterface
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html) && |  _other_
|  )  |
---|---|---|---|---|---

Definition at line [ 1402 ](move__group__interface_8cpp_source.html#l01402) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


[ moveit::planning_interface::MoveItErrorCode
](classmoveit_1_1planning__interface_1_1MoveItErrorCode.html)
moveit::planning_interface::MoveGroupInterface::execute  |  (  |  const [ Plan
](structmoveit_1_1planning__interface_1_1MoveGroupInterface_1_1Plan.html) & |
_plan_ |  )  |
---|---|---|---|---|---

Given a _plan_ , execute it while waiting for completion. Return true on
success.


Definition at line [ 1930 ](move__group__interface_8cpp_source.html#l01930) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


bool moveit::planning_interface::MoveGroupInterface::setPoseTarget  |  (  |
const geometry_msgs::PoseStamped & |  _target_ ,
---|---|---|---
|  |  const std::string & |  _end_effector_link_ = ` "" `
|  )  |  |

Set the goal pose of the end-effector _end_effector_link_ .


767  [ MoveItErrorCode
](classmoveit_1_1planning__interface_1_1MoveItErrorCode.html) pick(  const
std::string& object  ,  const  moveit_msgs::Grasp& grasp,  bool  plan_only =
false  );


We lower the allowed maximum velocity and acceleration to 5% of their maximum.
The default values are 10% (0.1). Set your preferred defaults in the
joint_limits.yaml file of your robot’s moveit_config or set explicit factors
in your code if you need your robot to move faster.


const std::string &
moveit::planning_interface::MoveGroupInterface::getPoseReferenceFrame  |  (  |
|  )  |  const
---|---|---|---|---

Get the reference frame set by [ setPoseReferenceFrame()
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#aac4b6f7cb3c3257001ccbd64c6d14f46
"Specify which reference frame to assume for poses specified without a
reference frame. ") . By default this is the reference frame of the robot
model.


std::string MoveGroupInterface::getDefaultPlanningPipelineId() const
{
  return impl_->getDefaultPlanningPipelineId();
}
void MoveGroupInterface::setPlanningPipelineId(const std::string& pipeline_id)
{
  impl_->setPlanningPipelineId(pipeline_id);
}
const std::string& MoveGroupInterface::getPlanningPipelineId() const
{
  return impl_->getPlanningPipelineId();
}
std::string MoveGroupInterface::getDefaultPlannerId(const std::string& group) const
{
  return impl_->getDefaultPlannerId(group);
}
void MoveGroupInterface::setPlannerId(const std::string& planner_id)
{
  impl_->setPlannerId(planner_id);
}
const std::string& MoveGroupInterface::getPlannerId() const
{
  return impl_->getPlannerId();
}
void MoveGroupInterface::setNumPlanningAttempts(unsigned int num_planning_attempts)
{
  impl_->setNumPlanningAttempts(num_planning_attempts);
}
void MoveGroupInterface::setMaxVelocityScalingFactor(double max_velocity_scaling_factor)
{
  impl_->setMaxVelocityScalingFactor(max_velocity_scaling_factor);
}
void MoveGroupInterface::setMaxAccelerationScalingFactor(double max_acceleration_scaling_factor)
{
  impl_->setMaxAccelerationScalingFactor(max_acceleration_scaling_factor);
}
moveit::core::MoveItErrorCode MoveGroupInterface::asyncMove()
{
  return impl_->move(false);
}


](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#ab3da0c13e080a5e2c8b45f5d278cfa4e)
(const std::string &group, const [ boost::shared_ptr
](../../../api/roscpp_traits/html/classboost_1_1shared__ptr.html) < [
tf::Transformer ](../../../api/tf/html/c++/classtf_1_1Transformer.html) > &tf=
[ boost::shared_ptr
](../../../api/roscpp_traits/html/classboost_1_1shared__ptr.html) < [
tf::Transformer ](../../../api/tf/html/c++/classtf_1_1Transformer.html) >(),
const [ ros::WallDuration
](../../../api/rostime/html/classros_1_1WallDuration.html) &wait_for_servers=
[ ros::WallDuration ](../../../api/rostime/html/classros_1_1WallDuration.html)
())
|  Construct a client for the [ MoveGroup
](classmoveit_1_1planning__interface_1_1MoveGroup.html "Deprecated Client
interface to access interfaces of the move_group node. ") action for a
particular _group_ .  More...

[ MOVEIT_DEPRECATED
](namespacemoveit_1_1planning__interface.html#a706399608538b81b2936e34817260537)
|  [ MoveGroupInterface
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a0a5276bac1000beafdccacae43105b67)
(const std::string &group, const [ boost::shared_ptr
](../../../api/roscpp_traits/html/classboost_1_1shared__ptr.html) < [
tf::Transformer ](../../../api/tf/html/c++/classtf_1_1Transformer.html) > &tf,
const [ ros::Duration ](../../../api/rostime/html/classros_1_1Duration.html)
&wait_for_servers)
|  [ MoveGroupInterface
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a34459a1d34eb981c4e91d0db0a4132cf)
(const [ MoveGroupInterface
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html) &)=delete
|  This class owns unique resources (e.g. action clients, threads) and its not
very meaningful to copy. Pass by references, move it, or simply create
multiple instances where required.  More...

|  [ MoveGroupInterface
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a77cbc5bfc70adaafa656d15c7446aaf5)
( [ MoveGroupInterface
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html) &&other)
|  [ MOVEIT_STRUCT_FORWARD
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a306b19b0ad6d9ae01728f1c38202a194)
( [ Plan


67  val = 0;


17  * with the distribution.


738  moveit_msgs::MoveItErrorCodes* error_code = NULL);


This is different from [ setPoseTarget()
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a5747a91e791f0089b784e3af2dbf4260
"Set the goal pose of the end-effector end_effector_link. ") in that a single
IK state (aka JointValueTarget) is computed using IK, and the resulting
JointValueTarget is used as the target for planning.


By enforcing ` joint  space  ` the planning process will use rejection
sampling to find valid requests. Please note that this might increase planning
time considerably.


moveit::planning_interface::MoveGroupInterface::~MoveGroupInterface  |  (  |
|  )  |
---|---|---|---|---

Definition at line [ 1397 ](move__group__interface_8cpp_source.html#l01397) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


[ ros::NodeHandle
](../../../api/roscpp/html/structros_1_1NodeHandle_1_1no__validate.html)


Definition at line [ 1477 ](move__group__interface_8cpp_source.html#l01477) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


Definition at line [ 2185 ](move__group__interface_8cpp_source.html#l02185) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


After this call, the JointValueTarget is used **instead** of any previously
set Position, Orientation, or Pose targets.


583  bool  setPoseTargets(  const  [ EigenSTL::vector_Affine3d
](../../../api/eigen_stl_containers/html/namespaceEigenSTL.html#a14f080ffb504c39aeeafc3e1c7590801)
& end_effector_pose,  const  std::string& end_effector_link =  ""  );


Definition at line [ 1645 ](move__group__interface_8cpp_source.html#l01645) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


Open two shells. In the first shell start RViz and wait for everything to
finish loading:


void moveit::planning_interface::MoveGroupInterface::setPlannerId  |  (  |
const std::string & |  _planner_id_ |  )  |
---|---|---|---|---|---

Specify a planner to be used for further planning.


void moveit::planning_interface::MoveGroupInterface::clearPoseTarget  |  (  |
const std::string & |  _end_effector_link_ = ` "" ` |  )  |
---|---|---|---|---|---

Forget pose(s) specified for _end_effector_link_ .


bool moveit::planning_interface::MoveGroupInterface::setJointValueTarget  |  (
|  const geometry_msgs::PoseStamped & |  _eef_pose_ ,
---|---|---|---
|  |  const std::string & |  _end_effector_link_ = ` "" `
|  )  |  |

Set the joint state goal for a particular joint by computing IK.


    goal_orientation_tolerance_ = tolerance;
  }
  void setPlanningTime(double seconds)
  {
    if (seconds > 0.0)
      allowed_planning_time_ = seconds;
  }
  double getPlanningTime() const
  {
    return allowed_planning_time_;
  }
  void constructMotionPlanRequest(moveit_msgs::msg::MotionPlanRequest& request) const
  {
    request.group_name = opt_.group_name;
    request.num_planning_attempts = num_planning_attempts_;
    request.max_velocity_scaling_factor = max_velocity_scaling_factor_;
    request.max_acceleration_scaling_factor = max_acceleration_scaling_factor_;
    request.allowed_planning_time = allowed_planning_time_;
    request.pipeline_id = planning_pipeline_id_;
    request.planner_id = planner_id_;
    request.workspace_parameters = workspace_parameters_;
    if (considered_start_state_)
    {
      moveit::core::robotStateToRobotStateMsg(*considered_start_state_, request.start_state);
    }
    else
    {
      request.start_state.is_diff = true;
    }
    if (active_target_ == JOINT)
    {
      request.goal_constraints.resize(1);
      request.goal_constraints[0] = kinematic_constraints::constructGoalConstraints(
          getTargetRobotState(), joint_model_group_, goal_joint_tolerance_);
    }
    else if (active_target_ == POSE || active_target_ == POSITION || active_target_ == ORIENTATION)
    {
      // find out how many goals are specified
      std::size_t goal_count = 0;
      for (const auto& pose_target : pose_targets_)


44  #include <moveit_msgs/RobotTrajectory.h>


260  double  getGoalJointTolerance()  const  ;


If _end_effector_link_ is empty then [ getEndEffectorLink()
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#aa329d5256a3fdf52911f2bdcfe3e31bc
"Get the current end-effector link. This returns the value set by
setEndEffectorLink\(\) \(or indirectly ...") is used.


49  #include <moveit_msgs/PlaceLocation.h>


##  Public Attributes

---
double  |  [ planning_time_
](structmoveit_1_1planning__interface_1_1MoveGroupInterface_1_1Plan.html#ab479de7a2494a40891cc7baf51a202a8)
|  The amount of time it took to generate the plan.  More...

moveit_msgs::RobotState  |  [ start_state_
](structmoveit_1_1planning__interface_1_1MoveGroupInterface_1_1Plan.html#ac9333762e84a22da5879866413dec8c6)
|  The full starting state used for planning.  More...

moveit_msgs::RobotTrajectory  |  [ trajectory_
](structmoveit_1_1planning__interface_1_1MoveGroupInterface_1_1Plan.html#af974e387daa3c09c4e19f29657a2b7cb)
|  The trajectory of the robot (may not contain joints that are the same as
for the start_state_)  More...

##  Detailed Description


129  {


void moveit::planning_interface::MoveGroupInterface::setConstraintsDatabase  |
(  |  const std::string & |  _host_ ,
---|---|---|---
|  |  unsigned int  |  _port_
|  )  |  |

Specify where the database server that holds known constraints resides.


` #include < [ moveit/planning_interface/move_group_interface.h
](move__group__interface_8h_source.html) > `


64  public  :


554  bool  setPoseTarget(  const  geometry_msgs::Pose& target,  const
std::string& end_effector_link =  ""  );


7  *


    if (code != rclcpp_action::ResultCode::SUCCEEDED)
    {
      RCLCPP_ERROR_STREAM(logger_, "MoveGroupInterface::move() failed or timeout reached");
    }
    return res->error_code;
  }
  moveit::core::MoveItErrorCode execute(const moveit_msgs::msg::RobotTrajectory& trajectory, bool wait,
                                        const std::vector<std::string>& controllers = std::vector<std::string>())
  {
    if (!execute_action_client_ || !execute_action_client_->action_server_is_ready())
    {
      RCLCPP_INFO_STREAM(logger_, "execute_action_client_ client/server not ready");
      return moveit::core::MoveItErrorCode::FAILURE;
    }
    bool done = false;
    rclcpp_action::ResultCode code = rclcpp_action::ResultCode::UNKNOWN;
    std::shared_ptr<moveit_msgs::action::ExecuteTrajectory_Result> res;
    auto send_goal_opts = rclcpp_action::Client<moveit_msgs::action::ExecuteTrajectory>::SendGoalOptions();
    send_goal_opts.goal_response_callback =
        [&](const rclcpp_action::ClientGoalHandle<moveit_msgs::action::ExecuteTrajectory>::SharedPtr& goal_handle) {
          if (!goal_handle)
          {
            done = true;
            RCLCPP_INFO(logger_, "Execute request rejected");
          }
          else
            RCLCPP_INFO(logger_, "Execute request accepted");
        };
    send_goal_opts.result_callback =
        [&](const rclcpp_action::ClientGoalHandle<moveit_msgs::action::ExecuteTrajectory>::WrappedResult& result) {
          res = result.result;
          code = result.code;
          done = true;
          switch (result.code)
          {
            case rclcpp_action::ResultCode::SUCCEEDED:
              RCLCPP_INFO(logger_, "Execute request success!");
              break;
            case rclcpp_action::ResultCode::ABORTED:
              RCLCPP_INFO(logger_, "Execute request aborted");


planning motion for the robot relative to the world.  More...

|  [ ~MoveGroupInterface
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a25988e27208f6c9fe20582d0319eed25)
()

Setting a joint state target (goal)

There are 2 types of goal targets:


The documentation for this class was generated from the following files:


456  bool  setApproximateJointValueTarget(  const  geometry_msgs::Pose&
eef_pose,  const  std::string& end_effector_link =  ""  );


106  {


###  Start the demo  ¶


836  bool  startStateMonitor(  double  wait = 1.0);


RViz provides many types of markers, in this demo we will use text, cylinders,
and spheres


11  *


    ROS_INFO_NAMED("tutorial", "Add an object into the world");
    planning_scene_interface.addCollisionObjects(collision_objects);


Definition at line [ 1554 ](move__group__interface_8cpp_source.html#l01554) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


**Definition:** [ move_group_interface.h:65
](move__group__interface_8h_source.html#l00065)


33  * POSSIBILITY OF SUCH DAMAGE.


    visual_tools.deleteAllMarkers();
    visual_tools.publishText(text_pose, "Object detached from robot", rvt::WHITE, rvt::XLARGE);
    visual_tools.trigger();

    /* Wait for MoveGroup to receive and process the attached collision object message */
    visual_tools.prompt("Press 'next' in the RvizVisualToolsGui window once the new object is detached from the robot");


783  [ MoveItErrorCode
](classmoveit_1_1planning__interface_1_1MoveItErrorCode.html)
planGraspsAndPick(  const  moveit_msgs::CollisionObject& object  ,  bool
plan_only =  false  );


Definition at line [ 2167 ](move__group__interface_8cpp_source.html#l02167) of
file [ move_group_interface.cpp ](move__group__interface_8cpp_source.html) .


Only one or the other is used for planning. Calling any of the
set*JointValueTarget() functions sets the current goal target to the
JointValueTarget. Calling any of the [ setPoseTarget()
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a5747a91e791f0089b784e3af2dbf4260
"Set the goal pose of the end-effector end_effector_link. ") , [
setOrientationTarget()
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a718268743cb7a60268803c8840d63a75
"Set the goal orientation of the end-effector end_effector_link to be the
quaternion \(x...") , [ setRPYTarget()
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a7f43684b3ccf3788d758c2aafa887353
"Set the goal orientation of the end-effector end_effector_link to be
\(roll,pitch,yaw\) radians...") , [ setPositionTarget()
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a417e37154a0f276de9ab70bae2fcad32
"Set the goal position of the end-effector end_effector_link to be \(x, y,
z\). ") functions sets the current goal target to the Pose target.

bool  |  [ setJointValueTarget
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a71e3819bd31711dcb81c18305ca9a521)
(const std::vector< double > &group_variable_values)
|  Set the JointValueTarget and use it for future planning requests.  More...

bool  |  [ setJointValueTarget
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a3c3eca8861fb5874961ea1feb4e77836)
(const std::map< std::string, double > &variable_values)
|  Set the JointValueTarget and use it for future planning requests.  More...

bool  |  [ setJointValueTarget
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#a81d64ae2586265816efa67c583cefd15)
(const robot_state::RobotState &robot_state)
|  Set the JointValueTarget and use it for future planning requests.  More...

bool  |  [ setJointValueTarget
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#aecfafc21c445b22697347bbaf4477ea5)
(const std::string &joint_name, const std::vector< double > & [ values
](../../../api/tf2/html/cache__unittest_8cpp.html#a2ad192c64ff93c02f9f41c320e7aa1bc)
)
|  Set the JointValueTarget and use it for future planning requests.  More...

bool  |  [ setJointValueTarget
](classmoveit_1_1planning__interface_1_1MoveGroupInterface.html#ab66f647d3361ba5208c497d05a23bec2)


moveit::planning_interface::MoveGroupInterface move_group_interface(PLANNING_GROUP);


47  #include <moveit_msgs/Constraints.h>


Show text in RViz of status