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

How to find the states/nodes of a path's trajectory?

asked 2020-12-29 23:07:45 -0500

grivera3 gravatar image

I'm using the move_group_interface (c++) to plan and visualize a path on the panda arm - that's the easy part.

What I need help with is to essentially break up the planned path into states and find the joint values of the arm at each individual state.

For example, if I have path P, I want to break up P into N states, where I can then have an Nx7 vector of joint values which make up the planned path.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-12-30 15:06:03 -0500

fvd gravatar image

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).

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-12-29 23:07:45 -0500

Seen: 94 times

Last updated: Dec 30 '20