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

questions about trajectory_msgs/JointTrajectory.msg

asked 2018-06-18 23:05:21 -0500

Legato_yuan gravatar image

updated 2018-06-19 02:06:54 -0500

gvdhoorn gravatar image

Hi guys. I'm so confused about trajectory_msgs/JointTrajectory.msg. Let's say I type

rostopic pub /nao_dcm/RightLeg_controller/command trajectory_msgs/JointTrajectory '{joint_names: ["RKneePitch","RHipPitch","RHipRoll"], points: [{positions:[0,0.9,0,0],velocities:[0,0.2,0.2,-2],time_from_start: [3.0,0]}]}' -1

There are three joints here, my question is which joint has the trajectory such as points:

[{positions:[0,0.9,0,0],velocities:[0,0.2,0.2,-2]

How to specify all three different joints' trajectory using the command above?

Wish you guys can help me with my problems.

Best Yuan

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-06-19 02:14:19 -0500

gvdhoorn gravatar image

updated 2018-06-19 02:21:19 -0500

There are three joints here, my question is which joint has the trajectory such as points [..]

With three joints, the message you show encodes a single trajectory with a single point (the points list contains only a single entry).

That single point has three values in each of the positions and velocities fields, one for each joint.

There is a problem though: names contains three (3) elements, while both positions and velocities contain four (4). That is invalid (the fourth value will be ignored by consumers).

How to specify all three different joints' trajectory using the command above?

If I understand you correctly: just add more entries to the points field (which is a list). Something like the following should work:

{
  "joint_names": [
    "RKneePitch",
    "RHipPitch",
    "RHipRoll"
  ],
  "points": [
    {
      "positions": [ .. ],
      "velocities": [ .. ],
      "time_from_start": [ .. ]
    },
    {
      "positions": [ .. ],
      "velocities": [ .. ],
      "time_from_start": [ .. ]
    },
    {
      "positions": [ .. ],
      "velocities": [ .. ],
      "time_from_start": [ .. ]
    }
    ,
    ...
  ]
}

be sure to update time_from_start for each point.

See also the documentation for trajectory_msgs/JointTrajectory and trajectory_msgs/JointTrajectoryPoint.

edit flag offensive delete link more

Comments

Note: I can't remember seeing time_from_start being a list, so you might want to verify that. That field is not linked to the nr of joints in your trajectory.

gvdhoorn gravatar image gvdhoorn  ( 2018-06-19 02:23:00 -0500 )edit

gvdhoorn, thank you so much, you do clear my doubt. I've creats multiple points and the robot behave as same as I expect.

Legato_yuan gravatar image Legato_yuan  ( 2018-06-19 13:45:23 -0500 )edit

However, I do feel like I'm just implement waypoints in the joint space. Here is what I'm really doing: From matlab I've got thousands of data of each joint,positions and velocities with tiny time step. Do you think it's good idea to use this joint trajectory controller? maybe some recommendation?

Legato_yuan gravatar image Legato_yuan  ( 2018-06-19 13:49:10 -0500 )edit

Question Tools

Stats

Asked: 2018-06-18 23:05:21 -0500

Seen: 2,247 times

Last updated: Jun 19 '18