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

perf(autoware_ndt_scan_matcher): replacement of pcl::KdTreeFLANN with nanoflann #10013

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

taisa1
Copy link
Contributor

@taisa1 taisa1 commented Jan 23, 2025

Description

This PR speeds up callback_sensor_points_main() on autoware_ndt_scan_matcher without changing the logical output.

The tail latency gets about x1.65 faster with this PR merged.
Screenshot from 2024-12-26 17-57-09

In this PR, I propose to replace pcl::KdTreeFLANN with nanoflann in this node.
nanoflann is a header-only kdtree library, a fork of FLANN used in PCL.

It is provided under the BSD license. kdtree_nanoflann.hpp contains code from nanoflann, so the license is displayed.

nanoflann.hpp is a copy from nanoflann v1.6.3, and is currently placed in include directory of this node, but will need to be moved if it is used on other nodes in the future.

Measurement Condition

  • Ubuntu22.04 + ROS2 Humble + Autoware Universe rosbag simulation
  • not core isolated / not core flequency fixed (so multi-threaded)

Related links

Private Links:

How was this PR tested?

  • I set up an environment that fixes the input to the node, and confirmed that changing to nanoflann results in an increase in speed without changing the output (details in TIER IV internal).
  • I confirmed that it can be run normally with sample rosbag simulation.

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

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

github-actions bot commented Jan 23, 2025

Thank you for contributing to the Autoware project!

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

Please ensure:

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)
Projects
Status: To Triage
Development

Successfully merging this pull request may close these issues.

1 participant