ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
You can see here that the Plan struct contains a moveit_msgs::RobotInterface message, so you should be able to access each point as follows, basing off this section in the tutorial something like this:
moveit::planning_interface::MoveGroupInterface::Plan plan;
move_group.plan(plan);
int i = 0;
trajectory_msgs::JointTrajectoryPoint point = plan.trajectory_.joint_trajectory.points[i];
But I am not sure why you would want to do this, since you can already execute and visualize the trajectory as described in this tutorial. You should not need to extract a vector of joint states - you can pass the JointTrajectory message directly to a controller (which the MoveGroupInterface
helps you do with the execute
command).