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): visualize matching score each point #8856

Merged
merged 12 commits into from
Sep 17, 2024

Conversation

SaltUhey
Copy link
Contributor

@SaltUhey SaltUhey commented Sep 12, 2024

Description

This PR visualizes the matching score each point to evaluate it qualitatively as shown in the figure.
The closer the color of the point is to red, the better the score, and the closer it is to blue, the worse the score.

It is important to know how well the map point cloud matches the sensor(LiDAR) point cloud.
Now, Autoware uses nearest voxel transform probability(NVTL) as a quantitative evaluation of matching score in each frame.

This implementation is expected to facilitate understanding for people.

Screenshot from 2024-09-12 10-51-36
Screenshot from 2024-09-17 13-11-52

Related links

tier4/ndt_omp#66

How was this PR tested?

Tests were conducted in some environments in real-time.

Notes for reviewers

Dependency with ndt_omp.

Interface changes

Add topic (not shown by default)

Topic changes

Additions and removals

Change type Topic Type Topic Name Message Type Description
Added Pub /voxel_score_points sensor_msgs::msg::PointCloud2 [debug topic] point cloud with scores

Effects on system behavior

None.

@github-actions github-actions bot added the component:localization Vehicle's position determination in its environment. (auto-assigned) label Sep 12, 2024
Copy link

github-actions bot commented Sep 12, 2024

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@SaltUhey SaltUhey marked this pull request as ready for review September 12, 2024 07:40
@SakodaShintaro SakodaShintaro added the tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Sep 12, 2024
Copy link

codecov bot commented Sep 17, 2024

Codecov Report

Attention: Patch coverage is 4.34783% with 22 lines in your changes missing coverage. Please review.

Project coverage is 27.81%. Comparing base (6effe2c) to head (c600e3d).
Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
...ion/ndt_scan_matcher/src/ndt_scan_matcher_core.cpp 4.34% 22 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8856      +/-   ##
==========================================
- Coverage   27.92%   27.81%   -0.12%     
==========================================
  Files        1324     1324              
  Lines       98877    98664     -213     
  Branches    39821    39606     -215     
==========================================
- Hits        27615    27441     -174     
+ Misses      71210    71143      -67     
- Partials       52       80      +28     
Flag Coverage Δ *Carryforward flag
differential 24.59% <4.34%> (?)
total 27.81% <ø> (-0.12%) ⬇️ Carriedforward from 6c68669

*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

@SakodaShintaro SakodaShintaro left a comment

Choose a reason for hiding this comment

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

I left some comments. Please either fix them or confirm if they can stay as they are.

Comment on lines +902 to +904
pcl::PointCloud<pcl::PointXYZI> nvs_points_in_map_ptr_i;
nvs_points_in_map_ptr_i =
ndt_ptr_->calculateNearestVoxelScoreEachPoint(*sensor_points_in_map_ptr);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's fine to directly assign the value.

Comment on lines +148 to +150
pcl::PointCloud<pcl::PointXYZRGB>::Ptr visualize_point_score(
const pcl::shared_ptr<pcl::PointCloud<PointSource>> & sensor_points_in_map_ptr,
const float & lower_nvs, const float & upper_nvs);
Copy link
Contributor

Choose a reason for hiding this comment

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

I like that this function returns pcl::PointCloud<pcl::PointXYZRGB> instead of pcl::PointCloud<pcl::PointXYZRGB>::Ptr.

nvs_points_in_map_ptr_i =
ndt_ptr_->calculateNearestVoxelScoreEachPoint(*sensor_points_in_map_ptr);
pcl::PointCloud<pcl::PointXYZRGB>::Ptr nvs_points_in_map_ptr_rgb{
new pcl::PointCloud<pcl::PointXYZRGB>};
Copy link
Contributor

Choose a reason for hiding this comment

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

To avoid multiple memory allocations, I think it would be better to call reserve before the for loop.

const float upper_nvs = 3.5f;
if (voxel_score_points_pub_->get_subscription_count() > 0) {
pcl::PointCloud<pcl::PointXYZRGB>::Ptr nvs_points_in_map_ptr_rgb{
new pcl::PointCloud<pcl::PointXYZRGB>};
Copy link
Contributor

Choose a reason for hiding this comment

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

Does 'nvs' stand for 'nvtl_score'? If so, it is better to replace it.

Copy link
Contributor

@SakodaShintaro SakodaShintaro left a comment

Choose a reason for hiding this comment

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

I will address the points I mentioned in a different pull request.
I have confirmed that logging_simulator works well the same as before.
@SaltUhey
Thank you so much!

@SakodaShintaro SakodaShintaro merged commit 029b394 into autowarefoundation:main Sep 17, 2024
33 of 34 checks passed
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) tag: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.

2 participants