ros2_controllers icon indicating copy to clipboard operation
ros2_controllers copied to clipboard

How to send repeated trajectory points to the pid_position_controller to make the joint rotate continuously

Open HPCLOL opened this issue 1 year ago • 5 comments

I use ros2 Iron to simulate the robot in gazebo classic.  Now, I am trying to make a joint rotate continuously. For some reasons, I have to control it with pid_position_controller in https://control.ros.org/rolling/doc/gazebo_ros2_control/doc/index.html#using-pid-control-joints. During the first rotation of the joint, I send it a series of trajectory points from -180 to 180 degrees. But because the pid_position_controller needs to receive increasing angle commands, I have to send trajectory points from 180 to 540 degrees to the controller so that it can complete the second rotation. If I still send trajectory points from -180 to 180, the joint will quickly rotate a circle in the opposite direction and then execute my trajectory, which sometimes causes the model to crash.  Is there any way I can send repeated trajectory point commands to achieve continuous rotation of the joint?  Thank you so much.

HPCLOL avatar Jun 27 '24 08:06 HPCLOL