Robot State with Attached Object in Motion plan Request

asked 2017-01-31 12:07:55 -0500

R.Mehra gravatar image

updated 2017-02-01 03:42:18 -0500

I have executed a node through which I have attached an object to my robot using the service apply_planning_scene.

I am writing another node where I want to send a motion plan request and I would like the planner to account for the attached object as well.

This is the snippet of the code for that :

robot_state::RobotStatePtr robot_state = group.getCurrentState(); //Get the current state of the robot with the attached object
moveit_msgs::RobotState rob_st;
bool copy_attached_bodies = true;
robot_state::RobotState rs; //
rs = boost::get<robot_state::RobotState>(robot_state);
robot_state::robotStateToRobotStateMsg(rs, rob_st, copy_attached_bodies);

And then I can send the rob_st as a robot_state in the motion plan request :

req.request.motion_plan_request.start_state = rob_st;

I am new to C++ and don't have much knowledge about pointers and stuff. And I could make out from these links that they deal with boost pointers:

http://docs.ros.org/groovy/api/moveit...

http://docs.ros.org/jade/api/moveit_c...

Is my technique right? Is there any other way through which I can send the current state of the robot(with attached object) in the motion plan request?

edit retag flag offensive close merge delete