Skip to content
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

fix(ndt_scan_matcher): make regularization process thread safe #5550

Merged

Conversation

KYabuuchi
Copy link
Contributor

@KYabuuchi KYabuuchi commented Nov 10, 2023

Description

  • Made regularization_pose_msg_ptr_array_ thread-safe.
  • Modified not to subscribe to regularization_pose when regularization is disabled.

The reason I did not include the regularization pose subscriber in the main_callback_group is so that the regularization process is not neglected even when sensor_callback becomes heavy. Please check the following links for more details:

Tests performed

I checked the below points using logging_simulator.

  1. when regularization_enabled in ndt_scan_matcher.param.yaml is false, regularization_pose is not subscribed. Also, localization results are as usual.

  2. When regularization_enabled is true, the node subscribes to the regularization_pose. When the logger level is set to DEBUG, the following log is shown on the console.

[ndt_scan_matcher-32] [DEBUG 1699834328.395343191] [localization.pose_estimator.ndt_scan_matcher]: Regularization pose is set to NDT
expected_log

Effects on system behavior

This does not affect.

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.

  • There are no open discussions or they are tracked via tickets.

After all checkboxes are checked, anyone who has write access can merge the PR.

@github-actions github-actions bot added the component:localization Vehicle's position determination in its environment. (auto-assigned) label Nov 10, 2023
Signed-off-by: Kento Yabuuchi <[email protected]>
@KYabuuchi KYabuuchi added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Nov 13, 2023
@KYabuuchi KYabuuchi marked this pull request as ready for review November 13, 2023 01:49
Copy link

codecov bot commented Nov 13, 2023

Codecov Report

Attention: 13 lines in your changes are missing coverage. Please review.

Comparison is base (a84c43b) 15.26% compared to head (97e46e9) 15.27%.
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5550   +/-   ##
=======================================
  Coverage   15.26%   15.27%           
=======================================
  Files        1713     1713           
  Lines      118192   118134   -58     
  Branches    37797    37764   -33     
=======================================
- Hits        18047    18046    -1     
+ Misses      79595    79538   -57     
  Partials    20550    20550           
Flag Coverage Δ *Carryforward flag
differential 3.73% <0.00%> (?)
total 15.27% <ø> (+<0.01%) ⬆️ Carriedforward from 5eb6389

*This pull request uses carry forward flags. Click here to find out more.

Files Coverage Δ
...ion/ndt_scan_matcher/src/ndt_scan_matcher_core.cpp 3.51% <0.00%> (-0.23%) ⬇️

... and 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@kminoda kminoda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR 🙏 LGTM except the following minor comment:

Signed-off-by: Kento Yabuuchi <[email protected]>
Signed-off-by: Kento Yabuuchi <[email protected]>

Co-authored-by: Yamato Ando <[email protected]>
@KYabuuchi KYabuuchi merged commit a0cd7ad into autowarefoundation:main Nov 13, 2023
21 of 25 checks passed
@KYabuuchi KYabuuchi deleted the fix/regularization_thread branch November 13, 2023 08:44
takayuki5168 pushed a commit to tier4/autoware.universe that referenced this pull request Nov 22, 2023
…arefoundation#5550)

* use mutex rather than main_callback_group

Signed-off-by: Kento Yabuuchi <[email protected]>

* subscribe reg_pose only when regularization is enabled

Signed-off-by: Kento Yabuuchi <[email protected]>

* add some comments to describe

Signed-off-by: Kento Yabuuchi <[email protected]>

* use initial_pose_callback_group

Signed-off-by: Kento Yabuuchi <[email protected]>

* fix typo (pauses->poses)

Signed-off-by: Kento Yabuuchi <[email protected]>

Co-authored-by: Yamato Ando <[email protected]>

---------

Signed-off-by: Kento Yabuuchi <[email protected]>
Co-authored-by: Yamato Ando <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:localization Vehicle's position determination in its environment. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants