How to find the end effector positions/co-ordinates for the whole plan (trajectory) in 'MoveIt!' ?
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?
Asked by KP_learner on 2020-07-09 09:28:29 UTC
Answers
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_);
Asked by xibeisiber on 2020-07-10 06:56:17 UTC
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.
Asked by KP_learner on 2020-07-11 12:37:03 UTC
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)
Asked by KP_learner on 2020-07-18 09:58:03 UTC
Comments