Ask Your Question
0

How to find the end effector positions/co-ordinates for the whole plan (trajectory) in 'MoveIt!' ?

asked 2020-07-09 09:28:29 -0600

KP_learner gravatar image

I am using the C++ interface for motion planning in MoveIt! (ROS Melodic). For a particular trajectory (or plan), I observed that it is possible to extract joint positions, velocities etc. Also, it is possible to extract end-effector position and orientation for the current pose. But I want to monitor the positions and orientations through which the end-effector passes in the whole path/trajectory while reaching the final goal pose. This can require extracting all those orientation and position co-ordinates of the end effector for the whole trajectory (in the plan). Could you please mention the ways in which this can be possibly achieved?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-07-10 06:56:17 -0600

xibeisiber gravatar image

I guess you can you can use the member function of robot_trajectory::RobotTrajectory class to get the info of waypoints.

To convert the move_group plan to robot_trajectory::RobotTrajectory:

 moveit::core::RobotModelConstPtr robot_model=group.getRobotModel();
 robot_trajectory::RobotTrajectory trajectory(robot_model, planning_group);
 trajectory.setRobotTrajectoryMsg(*(group.getCurrentState()),plan.trajectory_);
edit flag offensive delete link more

Comments

Thank you for your suggestion.

I will check on how to get the information on position and orientation of waypoints from this trajectory. And then, I will try to implement it.

I will update about it over here.

KP_learner gravatar image KP_learner  ( 2020-07-11 12:37:03 -0600 )edit

Hey.. I tried out the above code snippet and the system did not show me any compile/run time error when I tried to extract robot state at different waypoints from the trajectory.

I checked the function documentation page, but I am not able to find the end effector position (co-ordinates) directly from the robot state. Hence, could you please tell me how that can be done?

(Please note: I am using ROS melodic)

KP_learner gravatar image KP_learner  ( 2020-07-18 09:58:03 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2020-07-09 09:28:29 -0600

Seen: 346 times

Last updated: Jul 10 '20