Skip to content

refactor(autoware_radar_objects_adapter): align the README and the default_* parameters with what the node does - #13538

Merged
technolojin merged 2 commits into
autowarefoundation:mainfrom
kentdotn:docs/radar-objects-adapter-readme
Oct 26, 2026
Merged

technolojin merged 2 commits into
autowarefoundation:mainfrom
kentdotn:docs/radar-objects-adapter-readme

Conversation

@kentdotn

Copy link
Copy Markdown
Contributor

Description

Purpose

This PR is two small corrections that bring radar_objects_adapter and its README into line with each other, on the way through phase 5 of the separation of the conversion logic from the ROS node (the strategy of TrafficLightMapVisualizerNode, #12487 → #12612). Where the README was behind the code, the README is corrected; where the code was behind its own schema, the code is. Neither changes what the node publishes on the vehicle.

What changes

The README says what the node expects of its input (commit 1, documentation only). A new section, "What the input is expected to be", states what the conversion assumes rather than leaving it to the code: positions and their covariances are taken in the header frame and published as they are; velocities and accelerations are absolute and rotated into the object's frame; the absolute_dynamics flag is not checked; which object fields are required, and objects are dropped until a radar info declares them; and which fields fall back to the default_* parameters, with the yaw variances set only when the standard deviations are declared. The classification_remap section states that the probabilities are treated as independent confidences and are not merged when two labels map to the same one, in place of the note that only observed the duplicates. Everything it states is what the node has done since the characterization tests pinned it; the sentences that belong to a change in behavior travel with that change in later PRs.

The default_* parameters are read as double (commit 2). They were declared with declare_parameter<float> and stored as float in RadarObjectsAdapterParams, although the schema says number, rclcpp parameters are double, and every field they end up in (a position, a twist, a shape dimension) is double. They are now double end to end, and so is the value update_radar_info() reports for a defaulted field; the test parameters lose their casts. Values that a float represents exactly, such as the shipped configuration (0.0, 5.0, 2.0), come out the same. Any other value is no longer rounded to float precision on the way, which changes the output at the 1e-8 level. The existing cases use only exactly representable values and so could not tell the two apart; two new cases use values a float cannot represent (0.1, 4.1, ...) and check that they reach the output as written: Detections_UndeclaredFields_ParameterNotRoundedToFloat through the adapter (every defaulted field) and Construct_DefaultParameterNotRepresentableAsFloat_ReachesOutput through the node and its parameter declaration. Both fail on the float code (0.10000000149011612 instead of 0.1).

Related links

Parent Issue:

  • None

Related PRs:

How was this PR tested?

From the CI-equivalent dev container (ghcr.io/autowarefoundation/autoware:universe-dependencies-jazzy):

colcon build --packages-select autoware_radar_objects_adapter \
  --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo
colcon test --packages-select autoware_radar_objects_adapter \
  --event-handlers console_direct+
  • The 39 unit cases (38, whose parameter values lose a cast, plus the new one) and 7 node cases (6 plus the new one) pass; the package's tests pass with 0 failures. The two new cases were run against the float code as well and fail there.
  • markdownlint, clang-format, cpplint and the rest of the repository's pre-commit hooks pass.

Notes for reviewers

  • rclcpp stores a float parameter as its double and converts back on read; dropping that round trip is the whole code change.

Interface changes

None. The parameter names and the schema do not change.

Effects on system behavior

A default_* value that a float cannot represent exactly (for example 0.1) now reaches the output as written instead of rounded to float precision, a difference at the 1e-8 level. The shipped configuration is unaffected.

🤖 Generated with Claude Code

kentdotn and others added 2 commits October 22, 2026 17:46
…of its input

The README now says what the conversion assumes rather than leaving it
to the code: positions and their covariances are taken in the header
frame and published as they are, velocities and accelerations are
absolute and rotated into the object's frame, the absolute_dynamics
flag is not checked, and which object fields are required and which
fall back to the default_* parameters.

The classification_remap section states that the probabilities are
treated as independent confidences and are not merged when two labels
map to the same one, in place of the note that only observed the
duplicates.

None of this changes with the refactoring under way; it is what the
node has done since the characterization tests pinned it.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Kentaro NAGATOMO <kentaro.nagatomo@tier4.jp>
…rs as double

The six default_* parameters were declared as float and stored as
float in RadarObjectsAdapterParams, although rclcpp parameters are
double and every field they end up in (a position, a twist, a shape
dimension) is double. They are now double end to end, and so is the
value update_radar_info() reports for a defaulted field. The test
parameters lose their casts.

Values that a float represents exactly, such as the shipped
configuration (0.0, 5.0, 2.0), come out the same; any other value
changes the output at the 1e-8 level. The existing cases use only
exactly representable values and so could not tell the two apart;
two new cases use values a float cannot represent (0.1, 4.1, ...)
and check that they reach the output as written, one through the
adapter (every defaulted field) and one through the node and its
parameter declaration. Both fail on the float code.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: Kentaro NAGATOMO <kentaro.nagatomo@tier4.jp>
@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:

@github-actions github-actions Bot added type:documentation Creating or refining documentation. (auto-assigned) component:sensing Data acquisition from sensors, drivers, preprocessing. (auto-assigned) labels Oct 22, 2026
@kentdotn kentdotn added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Oct 22, 2026
@codecov

codecov Bot commented Oct 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 37.76%. Comparing base (a0c03c1) to head (3dbdda7).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #13538   +/-   ##
=======================================
  Coverage   37.76%   37.76%           
=======================================
  Files        2031     2031           
  Lines      141709   141709           
=======================================
  Hits        53519    53519           
  Misses      88190    88190           
Flag Coverage Δ *Carryforward flag
full-suite 37.76% <ø> (-0.01%) ⬇️ Carriedforward from a0c03c1

*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.

@kentdotn
kentdotn marked this pull request as ready for review October 23, 2026 05:23

@YoshiRi YoshiRi 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.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:sensing Data acquisition from sensors, drivers, preprocessing. (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

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants