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

feat(ndt_scan_matcher): added a function to check maximum distance of sensor points #6559

Conversation

SakodaShintaro
Copy link
Contributor

@SakodaShintaro SakodaShintaro commented Mar 7, 2024

Description

Context

The current ndt_scan_matcher does not check the normality of the input point cloud, and performs scan matching even when an abnormal point cloud comes in, leading to incorrect position estimation.

In particular, the pull requests below have been merged to make the default input point cloud topic /sensing/lidar/concatenated/pointcloud, which rarely outputs point clouds concatenated with short-range LiDAR only.

ndt_scan_matcher should check the validity of the input point cloud.

Changes

As a first step in checking the input point cloud, this PR checks to see if there are points are more than a specified distance apart.

Note

This PR must be merged with

Tests performed

It has been confirmed that the logging_simulator runs with the same accuracy as before on AWSIM data with GT.

sample rosbag

The probability of incorrect initial position estimation in Sample-rosbag performed under poor computational resources has been reduced from 3/7 to nearly 0/7.

Effects on system behavior

The possibility of ndt being incorrect is slightly reduced.

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 Mar 7, 2024
@SakodaShintaro SakodaShintaro self-assigned this Mar 7, 2024
@SakodaShintaro SakodaShintaro added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Mar 7, 2024
Copy link

codecov bot commented Mar 7, 2024

Codecov Report

Attention: Patch coverage is 0% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 14.78%. Comparing base (e1a3139) to head (f0a974c).
Report is 16 commits behind head on main.

Files Patch % Lines
...ion/ndt_scan_matcher/src/ndt_scan_matcher_core.cpp 0.00% 7 Missing ⚠️
...cher/include/ndt_scan_matcher/hyper_parameters.hpp 0.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6559      +/-   ##
==========================================
- Coverage   14.78%   14.78%   -0.01%     
==========================================
  Files        1917     1917              
  Lines      132040   132076      +36     
  Branches    39238    39264      +26     
==========================================
  Hits        19524    19524              
- Misses      90721    90754      +33     
- Partials    21795    21798       +3     
Flag Coverage Δ *Carryforward flag
differential 3.60% <0.00%> (?)
total 14.78% <ø> (ø) Carriedforward from 998e11c

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

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

Copy link
Contributor

@TaikiYamada4 TaikiYamada4 left a comment

Choose a reason for hiding this comment

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

@SakodaShintaro
Almost perfect to me!
I made a situation that the concatenation doesn't work well by making timeout_sec to 0.01 [s] from 0.1 [s] in the concatenate_data node, and the implementation in this PR worked well.

Apart for that, could you add the unit [m] to the warning message for clarity?

Signed-off-by: Shintaro SAKODA <[email protected]>
@anhnv3991
Copy link
Contributor

@SakodaShintaro It is just my opinion but should we create a new node to perform this check on input clouds; or can we move this function (cloud validation) to a node that performs pre-processing steps on clouds? Some reasons for this:

  • First, we can run scan checking and scan matching concurrently (align a scan while checking some others)
  • Second, we maintain the modularity of the system; i.e. ndt_scan_matching only performs scan matching (not validate input clouds), pre-processing node only validates clouds (not doing anything else)
  • Third, if there are other nodes that use these clouds, they can subscribe to this new node (that do the check and publish valid clouds) to get the validated clouds, and do not have to re-check the clouds.

@SakodaShintaro
Copy link
Contributor Author

@anhnv3991
Thank you for your comment :)

Although this is an important point, it seems like it will take some time to fix it, so I would like to try merging this PR as is.

The current autoware.universe is degraded, which initial position estimation fails with sample-rosbag with a probability of about 50%, so I would like to fix this as soon as possible.

However, since good design is of course important, I will address your points in detail.

(1) Concurrency
You are correct, but in this code, the computational complexity of checking sensor points is O(N). In NDT, N is usually around 1500, so it is not significant. Even in the future, the checking code may not become a heavy process.

(2) Modularity
I agree with you. How about creating a new class in the future, such as SensorPointsValidator and having NDTScanMatcher hold it as a member variable? Just as NDT's align processing is essentially implemented with ndt_omp, it may be desirable to create a dedicated class for checking input point clouds. I think NDTScanMatcher's responsibility is communication in ROS2. In any case, I agree that core logic should be written as little as possible in NDTScanMatcher.

(3) Reusability
I think the validation of input is different for each process. For example, points only from a short-range LiDAR may not be suitable for NDT but could be useful for other processes. In general, the requirements for inputs should be defined for each process.

Signed-off-by: Shintaro SAKODA <[email protected]>
@github-actions github-actions bot added the type:documentation Creating or refining documentation. (auto-assigned) label Mar 11, 2024
Copy link
Contributor

@TaikiYamada4 TaikiYamada4 left a comment

Choose a reason for hiding this comment

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

LGTM

@SakodaShintaro SakodaShintaro merged commit b8c9701 into autowarefoundation:main Mar 12, 2024
24 of 27 checks passed
@SakodaShintaro SakodaShintaro deleted the feat/check_max_distance_of_sensor_points_in_ndt branch March 12, 2024 08:56
kaigohirao pushed a commit to kaigohirao/autoware.universe that referenced this pull request Mar 22, 2024
… sensor points (autowarefoundation#6559)

* Added function to check maximum distance of sensor points

Signed-off-by: Shintaro SAKODA <[email protected]>

* style(pre-commit): autofix

* Added unit

Signed-off-by: Shintaro SAKODA <[email protected]>

* Fixed json schema

Signed-off-by: Shintaro SAKODA <[email protected]>

---------

Signed-off-by: Shintaro SAKODA <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Signed-off-by: kaigohirao <[email protected]>
karishma1911 pushed a commit to Interplai/autoware.universe that referenced this pull request Jun 3, 2024
… sensor points (autowarefoundation#6559)

* Added function to check maximum distance of sensor points

Signed-off-by: Shintaro SAKODA <[email protected]>

* style(pre-commit): autofix

* Added unit

Signed-off-by: Shintaro SAKODA <[email protected]>

* Fixed json schema

Signed-off-by: Shintaro SAKODA <[email protected]>

---------

Signed-off-by: Shintaro SAKODA <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
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) type:documentation Creating or refining documentation. (auto-assigned)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants