-
Notifications
You must be signed in to change notification settings - Fork 445
Description
Describe the bug
Sending commands to a trajectory controller with position command interface through the rqt_joint_trajectory_controller leads to erratic joint movements. This happens in simulation as well as on the real hardware. Upon further investigation, the rqt tool sends the configured joint position as a trajectory with time_from_start: 1.0 repeatedly with 10 Hz. E.g.:
header:
stamp:
sec: 0
nanosec: 0
frame_id: ''
joint_names:
- joint_1
points:
- positions:
- 1.0
velocities: []
accelerations: []
effort: []
time_from_start:
sec: 1
nanosec: 0
I suspect that the fixed time_from_start value with the same goal state leads to a slightly different interpolated trajectory each time because the joint has already moved a bit. This might lead to jumps in the goal position.
Indeed, this hypothesis can be verified by manually sending a trajectory:
Sending just one trajectory message leads to a smooth trajectory as expected:
ros2 topic pub /trajectory_controller/joint_trajectory trajectory_msgs/msg/JointTrajectory "header:
stamp:
sec: 0
nanosec: 0
frame_id: ''
joint_names: ["joint_1"]
points: [{positions: [1.0], time_from_start: {sec: 3}}]" -1
but if the same message is sent with 10 Hz -r 10, an erratic behavior can be observed.
I have not tested any other command interfaces.
To Reproduce
Steps to reproduce the behavior:
- Start a joint trajectory controller with position command interface
- Start rqt_joint_trajectory_controller
- Move any joint
- The joint with show erratic behavior
Expected behavior
The joint should move smoothly
Screenshots
This graph shows that the generated reference trajectory (blue line) already contains the jitter:
Environment (please complete the following information):
- OS: Ubuntu 24.04
- Version Jazzy 4.21.0-1noble.20250304.234108
