Skip to content

refactor(ndt_scan_matcher): ROS-free hyper parameters and node rename - #1558

Draft
sasakisasaki wants to merge 3 commits into
autowarefoundation:mainfrom
sasakisasaki:ndt-core/2-ros-free-parameters-and-node-rename
Draft

sasakisasaki wants to merge 3 commits into
autowarefoundation:mainfrom
sasakisasaki:ndt-core/2-ros-free-parameters-and-node-rename

Conversation

@sasakisasaki

@sasakisasaki sasakisasaki commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Why Currently Draft?

Self-review has not been done yet 🙏

Description

⚠️ As this PR's contents are mostly generated by Claude Code, I'll review the changes carefully to ensure this PR aligns with the intended refactoring goals and do not introduce unintended side effects. I'll mark this PR as "Ready for Review" after my review. ⚠️

Two preparation steps for the core logic extraction:

  1. Hyper parameters without ROS. HyperParameters becomes a plain struct. Declaring and reading the ROS parameters moves into declare_hyper_parameters(node) in the new hyper_parameters_loader.{hpp,cpp}. This is the only place that knows which ROS parameter fills which field. Code that holds the values no longer depends on rclcpp.
  2. Node rename. The node class NDTScanMatcher becomes NdtScanMatcherNode, and ndt_scan_matcher_core.{hpp,cpp} become ndt_scan_matcher_node.{hpp,cpp}. This frees the name NdtScanMatcher for the core class added in PR 4. The test harness, the fixture and the design yaml follow the rename.

Related links

Stack (each PR is based on the one before it):

I'll update the list of stack PRs status below, as I like to ensure the step, I'm going to create the PR after merging currently ongoing one.

  1. feat(localization_util): allow SmartPoseBuffer without a logger #1549
  2. refactor(ndt_scan_matcher): make scan matching diagnostics ROS-free #1552
  3. This PR: ROS-free hyper parameters and node rename
  4. #TBD: fetch-only MapUpdateModule
  5. #TBD: NdtScanMatcher core
  6. #TBD: scan matching returns its outputs (5a)
  7. #TBD: scan matching in the core (5b)

How was this PR tested?

Ran the following command:

$ PACKAGE_NAME=autoware_ndt_scan_matcher \
    && colcon build --packages-up-to $PACKAGE_NAME --cmake-args -DCMAKE_BUILD_TYPE=Release \
    && colcon test --packages-select $PACKAGE_NAME --event-handlers console_cohesion+

All tests, including the characterization tests, pass unchanged.

Notes for reviewers

  • Component plugin name: it changes from autoware::ndt_scan_matcher::NDTScanMatcher to autoware::ndt_scan_matcher::NdtScanMatcherNode. The executable name autoware_ndt_scan_matcher_node is unchanged. Autoware launches the node through this package's ndt_scan_matcher.launch.xml, which starts the executable, so the launch files are not affected. Anyone loading the plugin by name into a container would need the new name.

Possible Impact Scope

(20th Nov. 2026) Should be none for autowarefoundation's autoware_launch and autoware_core:

  • The autoware_launch side, autoware_ndt_scan_matcher is launched as follows(Reference)
    <include file="$(find-pkg-share autoware_ndt_scan_matcher)/launch/ndt_scan_matcher.launch.xml">
      <arg name="input_pointcloud" value="/localization/util/downsample/pointcloud"/>
      <arg name="input_initial_pose_topic" value="/localization/pose_twist_fusion_filter/biased_pose_with_covariance"/>
      <arg name="input_regularization_pose_topic" value="/sensing/gnss/pose_with_covariance"/>
      <arg name="input_service_trigger_node" value="/localization/pose_estimator/trigger_node"/>

      <arg name="output_pose_topic" value="/localization/pose_estimator/pose"/>
      <arg name="output_pose_with_covariance_topic" value="$(var output_pose_with_covariance_topic)"/>

      <arg name="client_map_loader" value="/map/get_differential_pointcloud_map"/>

      <arg name="param_file" value="$(var ndt_scan_matcher/ndt_scan_matcher_param_path)"/>
    </include>
  • In the autoware_core side, the autoware_ndt_scan_matcher_node executable is used (not component plugin autoware::ndt_scan_matcher::NDTScanMatcher) as follows (Reference)
  <node pkg="autoware_ndt_scan_matcher" exec="autoware_ndt_scan_matcher_node" name="$(var node_name)" output="both">
    <env name="LD_PRELOAD" value="$(var ld_preload_value)"/>
    <remap from="points_raw" to="$(var input_pointcloud)"/>
    <remap from="ekf_pose_with_covariance" to="$(var input_initial_pose_topic)"/>
    <remap from="regularization_pose_with_covariance" to="$(var input_regularization_pose_topic)"/>
    <remap from="trigger_node_srv" to="$(var input_service_trigger_node)"/>

    <remap from="ndt_pose" to="$(var output_pose_topic)"/>
    <remap from="ndt_pose_with_covariance" to="$(var output_pose_with_covariance_topic)"/>

    <remap from="pcd_loader_service" to="$(var client_map_loader)"/>

    <param from="$(var param_file)"/>
  </node>

Interface changes

Component plugin name: autoware::ndt_scan_matcher::NDTScanMatcher → autoware::ndt_scan_matcher::NdtScanMatcherNode. No topic or parameter changes.

Effects on system behavior (in entire Autoware)

As above the plugin name changed: autoware::ndt_scan_matcher::NDTScanMatcher → autoware::ndt_scan_matcher::NdtScanMatcherNode. All places that are using autoware::ndt_scan_matcher::NDTScanMatcher need to apply the fix for launch file.

@github-actions

Copy link
Copy Markdown

Thank you for contributing to the Autoware project!

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

Please ensure:

@sasakisasaki sasakisasaki self-assigned this Nov 20, 2026
@sasakisasaki sasakisasaki added run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) component:localization Vehicle's position determination in its environment. (auto-assigned) labels Nov 20, 2026
@codecov

codecov Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.15385% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.66%. Comparing base (c22804f) to head (48fd3e9).

Files with missing lines Patch % Lines
...e_ndt_scan_matcher/src/hyper_parameters_loader.cpp 95.89% 3 Missing ⚠️
...are_ndt_scan_matcher/src/ndt_scan_matcher_node.cpp 96.77% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1558      +/-   ##
==========================================
+ Coverage   82.34%   82.66%   +0.31%     
==========================================
  Files         421      423       +2     
  Lines       23903    24476     +573     
  Branches      147      147              
==========================================
+ Hits        19683    20233     +550     
- Misses       4190     4213      +23     
  Partials       30       30              
Flag Coverage Δ *Carryforward flag
daily ?
full-suite 82.30% <ø> (-0.04%) ⬇️ Carriedforward from 29db97d

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

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sasakisasaki sasakisasaki changed the title Ndt core/2 ros free parameters and node rename refactor ros free parameters and node rename Nov 20, 2026
@sasakisasaki sasakisasaki changed the title refactor ros free parameters and node rename refactor(ndt_scan_matcher): ROS-free hyper parameters and node rename Nov 20, 2026

@xmfcx xmfcx left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

sasakisasaki and others added 2 commits November 24, 2026 14:51
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
…free the name for the core logic

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
@Motsu-san
Motsu-san force-pushed the ndt-core/2-ros-free-parameters-and-node-rename branch from a2084cc to 910aa3a Compare November 24, 2026 06:10
@Motsu-san

Motsu-san commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

@sasakisasaki cc @xmfcx
Rebased onto the latest main (on top of #1527). Here is how I resolved the conflicts:

Commit 1 (refactor: separate ROS dependency from hyper paramter struct definition)

  • hyper_parameters.hpp: switched to upstream's autoware/ndt_scan_matcher_common/ndt_types.hpp, and kept the header free of rclcpp and agnocast, as this PR intends.
  • feat(autoware_ndt_scan_matcher): add the ndt.backend parameter #1533 added the ndt.backend parameter to the HyperParameters constructor. I moved that read into src/hyper_parameters_loader.cpp so it follows this PR's split. The try/catch that tells users to add backend: "ndt_omp" when the parameter is missing is still there.
    This was a judgment call, not a mechanical merge, so please review this part closely.
  • CMakeLists.txt: kept upstream's NO_TARGET_LINK_LIBRARIES and the backend sources (ndt_backend_loader.cpp, ndt_omp/estimate_covariance.cpp), and added hyper_parameters_loader.cpp.

Commit 2 (refactor(ndt_scan_matcher): rename the node to NdtScanMatcherNode ...)

  • Used upstream's new signatures that take NdtBackend &, and renamed the class to NdtScanMatcherNode.
  • Also renamed the NDTScanMatcher:: qualifiers that upstream added after this PR was opened, such as create_ndt_backend.

Verified locally: autoware_ndt_scan_matcher and its dependencies build, and colcon test passes (187 tests, 0 failures).

Could you review these?

@xmfcx
xmfcx self-requested a review November 24, 2026 09:03
@xmfcx

xmfcx commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Thanks @motsu -san for your help. @sasakisasaki -san could you create a parent issue for this refactoring task? And link the related PRs (including merged ones) to that issue and vice versa. This way it is easy to track the scope and related PRs and the overall work on this specific task.

@sasakisasaki

Copy link
Copy Markdown
Contributor Author

(My TODO) @xmfcx san. Thank you for your cooperation, and I'm sorry for interrupting your ongoing PRs deeply. Yes, I'll make the list of steps for refactoring task, without interrupting other ongoing PRs including yours 👍. Hopefully by this Thursday 3rd Dec. (as I'll (we'll) need to organize my some tasks in TIER IV in these days 🙏 )

@sasakisasaki

Copy link
Copy Markdown
Contributor Author

@xmfcx I have created the issue for my TODO here 👍

This branch has not been deployed

No deployments
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.

3 participants