ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

The return value of move_group.plan() may be yaml.dump(..)-able, but the yaml.load(..)-ed version of that is just a dict.

move_group.execute(..) does not take a dict.

The return value of move_group.plan() may be yaml.dump(..)-able, but the yaml.load(..)-ed version of that is just a dict., not an actual Plan instance.

move_group.execute(..) does not take a dict, hence the error message when it tries to use whatever you're passing it as a Plan.

The return value of move_group.plan() may be yaml.dump(..)-able, but the yaml.load(..)-ed version of that is just a dict, not an actual Plan instance.

move_group.execute(..) does not take a dict, hence the error message when it tries to use whatever you're passing it as a Plan.

From the move_group.py documentation:

 def plan(self, joints=None):
     """Return a tuple of the motion planning results such as
     (success flag : boolean, trajectory message : RobotTrajectory,
      planning time : float, error code : MoveitErrorCodes)"""
     if type(joints) is JointState:
         self.set_joint_value_target(joints)

     elif type(joints) is Pose:
         self.set_pose_target(joints)

     elif joints is not None:
         try:
             self.set_joint_value_target(self.get_remembered_joint_values()[joints])
         except MoveItCommanderException:
             self.set_joint_value_target(joints)

     (error_code_msg, trajectory_msg, planning_time) = self._g.plan()

     error_code = MoveItErrorCodes()
     error_code.deserialize(error_code_msg)
     plan = RobotTrajectory()
     return (
         error_code.val == MoveItErrorCodes.SUCCESS,
         plan.deserialize(trajectory_msg),
         planning_time,
         error_code,
     )

Note how the return value is a tuple, with at least one element being a RobotTrajectory instance.

You might be able to transform one of the members of the dict you yaml.load(..) into a RobotTrajectory instance again using something like rospy_message_converter, but no guarantees.