The trajectory_msgs/JointTrajectory
message is as follows:
std_msgs/Header header
uint32 seq
time stamp
string frame_id
string[] joint_names
trajectory_msgs/JointTrajectoryPoint[] points
float64[] positions
float64[] velocities
float64[] accelerations
duration time_from_start
If you have an arm with 7 joints, and a trajectory with 100 points, then the size of joint_names
should be 7 and the size of points
should be 100. For each point, the elements positions
, velocities
, and accelerations
will be of size 7.
The idea is that for point p
and joint j
, joint_names[j]
corresponds to points[p].positions[j]
Originally posted by jbohren with karma: 5809 on 2013-02-11
This answer was ACCEPTED on the original site
Post score: 12
Original comments
Comment by PeterMilani on 2013-02-11:
beauty! Thanks for the clarification, -- a third option I hadn't considered!
Comment by Ashesh on 2013-03-02:
Is it possible in ROS to save a trajectory and then play it at a later time? One way I can think of is writing trajectory_msgs/JointTrajectory to a file and then reading it when I need to execute the trajectory. But I am not sure how to save duration time_to_start. Duration seems to have too many attributes.
Comment by PeterMilani on 2013-03-02:
Hi Ashesh you probably should have this as a separate question. But yes you could do this, you would need a node to read your trajectory file. The duration time_from_start (there is no time_to_start) is simply the duration from your header.stamp time. The header.stamp is your start time.
Comment by varunagrawal on 2016-02-01:
Can you please specify what should be the values for the position? Is it cartesian coordinates from the base of the robot? And in what units, metres or something else?
Comment by jbohren on 2016-02-10:
Positions are all in joint space, and the units depend on the kind of joint. The standard unit for revolute joints is radian, and the standard unit for prismatic joints is meters.
Comment by abhishek47 on 2022-02-05:
Also see The meaning of velocities, accelerations and time_from_start in JointTrajectoryPoint.msg