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

Revision history [back]

click to hide/show revision 1
initial version

I currently use
std::vector<double> joints = my_plan.trajectory_.joint_trajectory.points[plan.trajectory_.joint_trajectory.points.size()-1].positions;

which is kind of stupid because there is also std::vector::back(), so it should be

my_plan.trajectory_.joint_trajectory.points.back().positions

Here is the docs you need:

http://docs.ros.org/indigo/api/moveit_msgs/html/msg/RobotTrajectory.html

http://docs.ros.org/indigo/api/trajectory_msgs/html/msg/JointTrajectory.html

http://docs.ros.org/indigo/api/trajectory_msgs/html/msg/JointTrajectoryPoint.html

so positions is "float64[]" which translates to std::vector<double>

I currently use


std::vector<double> std::vector&lt;double> joints = my_plan.trajectory_.joint_trajectory.points[plan.trajectory_.joint_trajectory.points.size()-1].positions;

which is kind of stupid because there is also std::vector::back(), so it should be

 my_plan.trajectory_.joint_trajectory.points.back().positions

Here is the docs you need:

http://docs.ros.org/indigo/api/moveit_msgs/html/msg/RobotTrajectory.html

http://docs.ros.org/indigo/api/trajectory_msgs/html/msg/JointTrajectory.html

http://docs.ros.org/indigo/api/trajectory_msgs/html/msg/JointTrajectoryPoint.html

so positions is "float64[]" which translates to std::vector<double>