-
Notifications
You must be signed in to change notification settings - Fork 663
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ndt_scan_matcher): warn if the lidar scan has gone out of the range of the loaded map #7612
feat(ndt_scan_matcher): warn if the lidar scan has gone out of the range of the loaded map #7612
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7612 +/- ##
=======================================
Coverage 28.93% 28.94%
=======================================
Files 1605 1606 +1
Lines 117491 117464 -27
Branches 50490 50463 -27
=======================================
- Hits 34000 33995 -5
- Misses 74282 74295 +13
+ Partials 9209 9174 -35
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anhnv3991
The return value of should_update_map
indicates "whether the map should be updated", not "whether the vehicle has exited the map boundary". Therefore, it is incorrect to output the WARN message when the function returns true.
The check for whether the vehicle is outside the map boundary is already performed internally within should_update_map
, and an ERROR diagnostic is issued if a violation occurs. Additionally, since this function is called periodically in the timer callback, I think there is no need to check this in the sensor points callback as well.
The potential issue arises when waiting for a service response from map_loader. This waiting occurs within the timer_callback of MapUpdateModule, during which the conventional should_update_map
is not called.
So, could you modify the implementation to check that the vehicle does not go out of the map boundary while waiting for the service response ?
@KYabuuchi Why don't we just call a check in the main callback sensor point (of ndt_scan_matcher_core.cpp)? Basically the check by callback timer is performed periodically (e.g. every 200ms if ros2 bag play --clock 200). Hence, within that period (200ms) there is no check, and the vehicle could move outside of the map range if it travels fast enough. Checking from map_update_module while waiting for service is quite complicated, since map_update_module does not have access to the current position of NDT. Creating a shared pointer for the poses in such cases is unnecessary imo. |
@anhnv3991 From my understanding, NDT runs should_update_map in a separate thread from callback_sensor_points_main because:
Indeed, what you're saying is correct. I didn't anticipate this difficulty... 🤔 |
@KYabuuchi I see. I just checked the should_update_map again. You're right, should_update_map returns true does not mean the lidar has gone out of the map range. The if clause inside that function is what we need for checking. So how about this? We can define a method of map_update_module to check the map range, and just let the callback_sensor_points call that method on NDT poses. |
Signed-off-by: Anh Nguyen <[email protected]>
Signed-off-by: Anh Nguyen <[email protected]>
Thank you for contributing to the Autoware project! 🚧 If your pull request is in progress, switch it to draft mode. Please ensure:
|
@KYabuuchi Just a question: To change parameters of ndt_scan_matcher, I found 2 files
which have the same content. Which file do I have to edit to change parameters of ndt_scan_matcher? I thought colcon --symlink-install should link those files but it seems like it does not. |
@anhnv3991 When using These files contain the same content, and you can consider the parameter files in autoware.universe/* as sample parameter files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delayed response regarding this.
Basically, I think this PR will provide the desired functionality. 👍 But, there is a risk of data races between the sensor points callback and the timer callback, so we need to be careful.
I'm going to check this pull request now, but have all of Yabuuchi-san's comments been resolved yet? |
@SakodaShintaro Yes, I think so. |
…o avoid race condition when checking map range Signed-off-by: Anh Nguyen <[email protected]>
localization/ndt_scan_matcher/include/ndt_scan_matcher/map_update_module.hpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Anh Nguyen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks Good To Me
@KYabuuchi
Are your all comments already resolved?
I think it would also be good to have your approval before merging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the delayed review. All of my concerns have been addressed.
Looks Good To Me 🙆♂️
…nge of the loaded map (autowarefoundation#7612) * Warn if the initial NDT pose of the lidar has gone out of the map range Signed-off-by: Anh Nguyen <[email protected]> * style(pre-commit): autofix * Testing Signed-off-by: Anh Nguyen <[email protected]> * style(pre-commit): autofix * Add mutex and a secondary last_update_position to map_update_module to avoid race condition when checking map range Signed-off-by: Anh Nguyen <[email protected]> * style(pre-commit): autofix * Remove last_update_pos_ and use mutex for last_update_position_ Signed-off-by: Anh Nguyen <[email protected]> * style(pre-commit): autofix --------- Signed-off-by: Anh Nguyen <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Description
Tests performed
... [ndt_scan_matcher_node-39] [WARN] [1718934187.199986673] [localization.pose_estimator.ndt_scan_matcher]: Lidar has gone out of the map range ...
Effects on system behavior
None
Interface changes
None
Pre-review checklist for the PR author
The PR author must check the checkboxes below when creating the PR.
In-review checklist for the PR reviewers
The PR reviewers must check the checkboxes below before approval.
Post-review checklist for the PR author
The PR author must check the checkboxes below before merging.
After all checkboxes are checked, anyone who has write access can merge the PR.