[collision_monitor] Add temporal debounce for min_points trigger#6006
Conversation
Signed-off-by: Xlqmu <3212929002@qq.com>
Codecov Report❌ Patch coverage is
... and 5 files with indirect coverage changes 🚀 New features to boost your workflow:
|
Signed-off-by: Xlqmu <3212929002@qq.com>
Signed-off-by: Xlqmu <3212929002@qq.com>
mini-1235
left a comment
There was a problem hiding this comment.
@gennartan would you mind taking a look and doing a review here?
|
btw,this is the bag I used for testing. |
gennartan
left a comment
There was a problem hiding this comment.
Overall, everything seems to be working correctly on my side and the changes look good 👍
I only left two small comments that should help the PR integrate a bit better with the rest of the project.
Signed-off-by: Xlqmu <3212929002@qq.com>
|
Thanks, updated and pushed. @gennartan |
Signed-off-by: Xlqmu <3212929002@qq.com>
|
Hi @SteveMacenski, gentle ping when you have a moment 🙏 |
|
Review now - sorry for the delay, I've been slammed and trying to get to as much as I can each day :-) |
| } | ||
|
|
||
| if (polygon->getPointsInside(sources_collision_points_map) >= polygon->getMinPoints()) { | ||
| const int points_inside = polygon->getPointsInside(sources_collision_points_map); |
There was a problem hiding this comment.
Question (not asking for the change necessarily): Does it make sense potentially to have the getPointsInside now be an internal detail of an API like isTriggered() rather than externally getting the points in this application? Seems unimportant now to have points_inside in the code of the monitor/detector nodes if we're moving the triggering logic internal to the polygons
There was a problem hiding this comment.
@Neomelt can you respond to my question and if you think that is better?
There was a problem hiding this comment.
You’re right — sorry for the earlier brief reply.I agree that direction is better long-term: encapsulating getPointsInside() behind a trigger-oriented API would clean up monitor/detector logic.For this PR I kept scope focused on debounce and lifecycle/state consistency, maybe I can open a focused follow-up refactor PR for that API cleanup.
There was a problem hiding this comment.
Would it be possible to do it here? Rename isTriggeredByPoints to isTriggered and get the getPointsInside first thing in the function for use.
ff6198f to
46c2524
Compare
Signed-off-by: Xlqmu <3212929002@qq.com>
46c2524 to
f27c4fb
Compare
|
@SteveMacenski Thanks a lot for the detailed review — I applied your suggestions and pushed some changes.I also reran the tests on Jazzy locally and everything is green.When you get a chance, could you take another look at the PR? |
|
@Neomelt approved minus the 2 items I reopened and tagged you in from the last review |
…n API Signed-off-by: Neomelt <niezhenghua2004@gmail.com>
|
Pushed follow-up in |
|
Thanks for the direct and detailed feedback throughout this PR. |
|
Anytime and thanks for the help! This is a great feature to have :-) |
Basic Info
Description of contribution in a few bullet points
min_pointstrigger evaluation innav2_collision_monitortrigger_consecutive_points(default1)release_consecutive_points(default1)processStopSlowdownLimit()forSTOP/SLOWDOWN/LIMIT1Description of documentation updates required from your changes
trigger_consecutive_pointsrelease_consecutive_points3/3)Description of how this change was tested
colcon build --packages-up-to nav2_collision_monitor --symlink-install --cmake-args -DBUILD_TESTING=OFF/home/neomelt/Downloads/indoor_2min_bag//livox/lidar(pointcloud)/cm_cmd_vel_stampedodom -> base_footprintbase_footprint -> livox_frameaction_typeswitching count from/collision_monitor_state:1/1:samples=16,switches=153/3:samples=10,switches=94/4:samples=10,switches=95/5:samples=10,switches=92/4:samples=15,switches=142/5:samples=15,switches=143/5:samples=10,switches=93/3reduces toggling versus baseline (15 -> 9, ~40% reduction in this replay)Future work that may be required in bullet points
Closes #4364