ros-controls / ros2_controllers

Generic robotic controllers to accompany ros2_control
https://control.ros.org
Apache License 2.0
321 stars 290 forks source link

Fix correct usage of angular velocity in update_odometry() function (backport #1118) #1153

Closed mergify[bot] closed 1 month ago

mergify[bot] commented 1 month ago

Thanks for this nice steering_controllers_library!

Using it however, we noticed issues in the odometry calculation where our steered robot would spin incredibly fast. There seems a small math error in the calculation which this PR fixes: The integration expects distances and angles, while the accumulators expect a velocity.

Probably also relates to https://github.com/ros-controls/ros2_controllers/issues/937


This is an automatic backport of pull request #1118 done by Mergify.

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 86.50%. Comparing base (11e8ad7) to head (4b26290).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## humble #1153 +/- ## ========================================== - Coverage 86.81% 86.50% -0.32% ========================================== Files 86 86 Lines 7486 7497 +11 Branches 619 619 ========================================== - Hits 6499 6485 -14 - Misses 753 777 +24 - Partials 234 235 +1 ``` | [Flag](https://app.codecov.io/gh/ros-controls/ros2_controllers/pull/1153/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/ros-controls/ros2_controllers/pull/1153/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls) | `86.50% <100.00%> (-0.32%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/ros-controls/ros2_controllers/pull/1153?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls) | Coverage Δ | | |---|---|---| | [...ring\_controllers\_library/src/steering\_odometry.cpp](https://app.codecov.io/gh/ros-controls/ros2_controllers/pull/1153?src=pr&el=tree&filepath=steering_controllers_library%2Fsrc%2Fsteering_odometry.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls#diff-c3RlZXJpbmdfY29udHJvbGxlcnNfbGlicmFyeS9zcmMvc3RlZXJpbmdfb2RvbWV0cnkuY3Bw) | `69.03% <100.00%> (ø)` | | | [...ontrollers\_library/test/test\_steering\_odometry.cpp](https://app.codecov.io/gh/ros-controls/ros2_controllers/pull/1153?src=pr&el=tree&filepath=steering_controllers_library%2Ftest%2Ftest_steering_odometry.cpp&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls#diff-c3RlZXJpbmdfY29udHJvbGxlcnNfbGlicmFyeS90ZXN0L3Rlc3Rfc3RlZXJpbmdfb2RvbWV0cnkuY3Bw) | `100.00% <100.00%> (ø)` | | ... and [5 files with indirect coverage changes](https://app.codecov.io/gh/ros-controls/ros2_controllers/pull/1153/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ros-controls)