ros2_controllers icon indicating copy to clipboard operation
ros2_controllers copied to clipboard

Units of velocity feedback in diff_drive_controller

Open macstepien opened this issue 3 years ago • 2 comments

Currently velocity feedback in diff_drive_controller is expected to be in m/s. Taking into account that position feedback is in radians and velocity commands are in rad/s it seems quite odd. I think that it will be better to also use rad/s there, following change should be enough:

odometry_.updateFromVelocity(
        left_feedback_mean * left_wheel_radius * period.seconds(), right_feedback_mean * right_wheel_radius * period.seconds(), time);

macstepien avatar Aug 10 '22 15:08 macstepien

This sounds very plausible. You can open a PR and execute tests and see what they are saying. Maybe there are frew other places where this feedback is used and should be also adjusted.

destogl avatar Sep 26 '22 12:09 destogl

I executed tests locally, but noticed that even on the current master branch diff_drive_controller tests sometimes failed. It seems that correct_initialization_using_parameters is not really deterministic or there was something wrong with my setup (it would be nice to run CI on the PR that I created). Additionally I looked into this test and it doesn't look like my change will be executed there. I also checked if any other change will be necessary, but it seems that it was the only place.

macstepien avatar Oct 17 '22 12:10 macstepien