ros2_controllers
ros2_controllers copied to clipboard
Add velocity limit for wheel in diff_drive_controller
In a differential drive controller, each motor individually have a velocity limit. Even if the velocity is limited for linear speed and for angular speed of the robot, the combination of the angular speed and linear speed may lead to overspeed of one motor. If the speed is limited in the hardware interface or by the motor itself, the heading of the robot won't follow the command velocity.
Describe the solution you'd like To keep the heading in the good direction, the speed of the other motor also have to be scaled down with the same factor. The velocity limit of the motor can be added to the parameters. When the update function is called, the speed of each motor is compared to the limits.
Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.
Additional context I tried the solution on the galactic branch, I prepared a pull request.