Ask Your Question
1

Understanding trajectory_msgs/JointTrajectory

asked 2013-02-11 12:03:19 -0500

updated 2014-01-28 17:15:11 -0500

ngrennan gravatar image

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

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
8

answered 2013-02-11 12:34:59 -0500

jbohren gravatar image

updated 2013-02-11 12:37:55 -0500

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]

edit flag offensive delete link more

Comments

beauty! Thanks for the clarification, -- a third option I hadn't considered!

PeterMilani gravatar imagePeterMilani ( 2013-02-11 12:42:34 -0500 )edit

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?

varunagrawal gravatar imagevarunagrawal ( 2016-02-01 20:48:25 -0500 )edit

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.

jbohren gravatar imagejbohren ( 2016-02-10 16:28:43 -0500 )edit
0

answered 2013-03-02 05:22:15 -0500

Ashesh gravatar image

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.

edit flag offensive delete link more

Comments

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.

PeterMilani gravatar imagePeterMilani ( 2013-03-02 11:40:18 -0500 )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

3 followers

Stats

Asked: 2013-02-11 12:03:19 -0500

Seen: 3,167 times

Last updated: Mar 02 '13