0
$\begingroup$

Rosanswers logo

Hi All

In working with the JointTrajectory message, I'm a bit unsure as to how the data should be filled.

If we have an arm with 7 joints, and a trajectory for those joints that has 100 points should the JointTrajectory message sizes be as follows:

joint_names -- size = 700

points -- size =700

if so, then should the arrays in JointTrajectoryPoints be all uniary?

Else should the sizes be:

joint_names -- size = 7

points -- size =7

and the position, velocity and acceleration arrays all be 100 in size. But if this is so, then time_from_start should also have 100 points. instead its just a single value

I know this can be a simple question but I'd appreciate some clarification.

cheers

Peter


Originally posted by PeterMilani on ROS Answers with karma: 1493 on 2013-02-11

Post score: 3

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.