fix(nav2_collision_monitor): use velocity magnitude for holonomic checks#5954
Conversation
SteveMacenski
left a comment
There was a problem hiding this comment.
There appear to be some problems related to an older version of Nav2 than what Main requires. Please revert the use of nav2_utils
f34d158 to
96c298a
Compare
mini-1235
left a comment
There was a problem hiding this comment.
Please also fix the linting and sign with DCO
Previously, VelocityPolygon only checked cmd_vel.x, ignoring lateral motion. This fix calculates the velocity vector magnitude when holonomic is set to true. Signed-off-by: Jaerak Son <sjr9017@naver.com>
Signed-off-by: Jaerak Son <sjr9017@naver.com>
Signed-off-by: Jaerak Son <sjr9017@naver.com>
… requirements Signed-off-by: Jaerak Son <sjr9017@naver.com>
…polygons_test.cpp Signed-off-by: Jaerak Son <sjr9017@naver.com>
ad0a7a1 to
14eb2bf
Compare
|
@mach0312 can you pull in main / rebase to fix CI? We patched the error and I need to see coverage metrics. How did your testing go? Were you able to show the bad behavior without and the good behavior with the patch? |
Codecov Report✅ All modified and coverable lines are covered by tests.
... and 6 files with indirect coverage changes 🚀 New features to boost your workflow:
|
|
Rebased on main to fix the CI issues. Yes, I confirmed the bad behavior without the patch and the correct behavior with it. 1. Technical Explanation of the "Bad Behavior"The core issue lies in how the
2. Verification (Videos)I performed a minimal test using a standalone
Before Patch (Bad Behavior) Screencast.from.2026-02-13.10-08-13.webmAfter Patch (Good Behavior) Screencast.from.2026-02-13.10-01-02.webm |
SteveMacenski
left a comment
There was a problem hiding this comment.
Just waiting for docs update fixes :-)
…cks (ros-navigation#5954) * fix(nav2_collision_monitor): use velocity magnitude for holonomic checks Previously, VelocityPolygon only checked cmd_vel.x, ignoring lateral motion. This fix calculates the velocity vector magnitude when holonomic is set to true. Signed-off-by: Jaerak Son <sjr9017@naver.com> * style: fix lint whitespace errors and typos Signed-off-by: Jaerak Son <sjr9017@naver.com> * Revert nav2_util usage to match main branch requirements Signed-off-by: Jaerak Son <sjr9017@naver.com> * Revert nav2_util usage in velocity_polygons_test to match main branch requirements Signed-off-by: Jaerak Son <sjr9017@naver.com> * Add missing copyright header to nav2_collision_monitor/test/velocity_polygons_test.cpp Signed-off-by: Jaerak Son <sjr9017@naver.com> --------- Signed-off-by: Jaerak Son <sjr9017@naver.com> Signed-off-by: panav <panav@10xconstruction.com>
…cks (ros-navigation#5954) * fix(nav2_collision_monitor): use velocity magnitude for holonomic checks Previously, VelocityPolygon only checked cmd_vel.x, ignoring lateral motion. This fix calculates the velocity vector magnitude when holonomic is set to true. Signed-off-by: Jaerak Son <sjr9017@naver.com> * style: fix lint whitespace errors and typos Signed-off-by: Jaerak Son <sjr9017@naver.com> * Revert nav2_util usage to match main branch requirements Signed-off-by: Jaerak Son <sjr9017@naver.com> * Revert nav2_util usage in velocity_polygons_test to match main branch requirements Signed-off-by: Jaerak Son <sjr9017@naver.com> * Add missing copyright header to nav2_collision_monitor/test/velocity_polygons_test.cpp Signed-off-by: Jaerak Son <sjr9017@naver.com> --------- Signed-off-by: Jaerak Son <sjr9017@naver.com> Signed-off-by: panav <panav@10xconstruction.com>
…cks (ros-navigation#5954) * fix(nav2_collision_monitor): use velocity magnitude for holonomic checks Previously, VelocityPolygon only checked cmd_vel.x, ignoring lateral motion. This fix calculates the velocity vector magnitude when holonomic is set to true. Signed-off-by: Jaerak Son <sjr9017@naver.com> * style: fix lint whitespace errors and typos Signed-off-by: Jaerak Son <sjr9017@naver.com> * Revert nav2_util usage to match main branch requirements Signed-off-by: Jaerak Son <sjr9017@naver.com> * Revert nav2_util usage in velocity_polygons_test to match main branch requirements Signed-off-by: Jaerak Son <sjr9017@naver.com> * Add missing copyright header to nav2_collision_monitor/test/velocity_polygons_test.cpp Signed-off-by: Jaerak Son <sjr9017@naver.com> --------- Signed-off-by: Jaerak Son <sjr9017@naver.com>
…cks (ros-navigation#5954) * fix(nav2_collision_monitor): use velocity magnitude for holonomic checks Previously, VelocityPolygon only checked cmd_vel.x, ignoring lateral motion. This fix calculates the velocity vector magnitude when holonomic is set to true. Signed-off-by: Jaerak Son <sjr9017@naver.com> * style: fix lint whitespace errors and typos Signed-off-by: Jaerak Son <sjr9017@naver.com> * Revert nav2_util usage to match main branch requirements Signed-off-by: Jaerak Son <sjr9017@naver.com> * Revert nav2_util usage in velocity_polygons_test to match main branch requirements Signed-off-by: Jaerak Son <sjr9017@naver.com> * Add missing copyright header to nav2_collision_monitor/test/velocity_polygons_test.cpp Signed-off-by: Jaerak Son <sjr9017@naver.com> --------- Signed-off-by: Jaerak Son <sjr9017@naver.com> Signed-off-by: panav <panav@10xconstruction.com>
…cks (ros-navigation#5954) * fix(nav2_collision_monitor): use velocity magnitude for holonomic checks Previously, VelocityPolygon only checked cmd_vel.x, ignoring lateral motion. This fix calculates the velocity vector magnitude when holonomic is set to true. Signed-off-by: Jaerak Son <sjr9017@naver.com> * style: fix lint whitespace errors and typos Signed-off-by: Jaerak Son <sjr9017@naver.com> * Revert nav2_util usage to match main branch requirements Signed-off-by: Jaerak Son <sjr9017@naver.com> * Revert nav2_util usage in velocity_polygons_test to match main branch requirements Signed-off-by: Jaerak Son <sjr9017@naver.com> * Add missing copyright header to nav2_collision_monitor/test/velocity_polygons_test.cpp Signed-off-by: Jaerak Son <sjr9017@naver.com> --------- Signed-off-by: Jaerak Son <sjr9017@naver.com> Signed-off-by: panav <panav@10xconstruction.com> Signed-off-by: Maurice <mauricepurnawan@gmail.com>
…cks (ros-navigation#5954) * fix(nav2_collision_monitor): use velocity magnitude for holonomic checks Previously, VelocityPolygon only checked cmd_vel.x, ignoring lateral motion. This fix calculates the velocity vector magnitude when holonomic is set to true. Signed-off-by: Jaerak Son <sjr9017@naver.com> * style: fix lint whitespace errors and typos Signed-off-by: Jaerak Son <sjr9017@naver.com> * Revert nav2_util usage to match main branch requirements Signed-off-by: Jaerak Son <sjr9017@naver.com> * Revert nav2_util usage in velocity_polygons_test to match main branch requirements Signed-off-by: Jaerak Son <sjr9017@naver.com> * Add missing copyright header to nav2_collision_monitor/test/velocity_polygons_test.cpp Signed-off-by: Jaerak Son <sjr9017@naver.com> --------- Signed-off-by: Jaerak Son <sjr9017@naver.com>
Basic Info
Description of contribution in a few bullet points
VelocityPolygonwherelinear_minandlinear_maxchecks were applied only tocmd_vel.x, ignoring lateral velocity for holonomic robots.isInRangelogic to calculate the resultant velocity magnitude whenholonomicis set to true, ensuring safety limits apply to the actual speed of motion in any direction.cmd_vel.x) to ensure backward compatibility.Description of documentation updates required from your changes
VelocityPolygondocumentation to clarify that whenholonomicis set to true,linear_minandlinear_maxrepresent the resultant speed magnitude.holonomic: false), the behavior remains unchanged, and negative values are still used for backward motion.docs.nav2.organd will submit a separate PR shortly.Description of how this change was tested
velocity_polygons_testto reflect the logic change (checking velocity magnitude instead of just x-component for holonomic robots) and confirmed that all tests passed usingcolcon test.Forward/Backward movement
Screencast from 2026-02-09 12-11-16.webm
Sideways/Lateral movement
Screencast from 2026-02-09 12-08-13.webm
Future work that may be required in bullet points
linear_minandlinear_maxto always represent velocity magnitude (speed) for all robot types in the future to ensure parameter consistency.holonomic: falseto guarantee backward compatibility.For Maintainers:
backport-*.