ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
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. 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.
2 | No.2 Revision |
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)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. 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.