Skip to content

feat(ekf_localizer): adjustable publishing of diagnostics#824

Closed
Motsu-san wants to merge 6 commits intoautowarefoundation:mainfrom
Motsu-san:feat/adjustable_publishing_of_diagnostics_on_ekf
Closed

feat(ekf_localizer): adjustable publishing of diagnostics#824
Motsu-san wants to merge 6 commits intoautowarefoundation:mainfrom
Motsu-san:feat/adjustable_publishing_of_diagnostics_on_ekf

Conversation

@Motsu-san
Copy link
Copy Markdown
Contributor

@Motsu-san Motsu-san commented Jan 30, 2026

Description

This PR adds functionality to make the diagnostics publishing frequency configurable in the ekf_localizer package and implements comprehensive tests to verify the behavior.

1. Add Configurable Diagnostics Publishing Frequency (4424425)

Feature Description

  • Made diagnostics publishing frequency controllable via parameter
  • Added diagnostics.diagnostics_publish_frequency parameter (default: 0.0 Hz = publish at every timer callback)
  • When set to a value greater than 0.0, diagnostics are published at the specified frequency
  • Uses a timer callback counter-based implementation to ensure accurate behavior even during rosbag playback when timestamps may be irregular

2. Add Tests for should_publish_diagnostics Function (780daa2)

Test Description

Added comprehensive test suite to verify the behavior of the should_publish_diagnostics() function.

Test Cases

  1. should_publish_diagnostics_period_zero: Verifies that it always returns true when diagnostics_publish_period is 0.0
  2. should_publish_diagnostics_period_negative: Verifies that it always returns true when diagnostics_publish_period is negative
  3. should_publish_diagnostics_period_less_than_ekf_dt: Verifies that it always returns true when diagnostics_publish_period is less than ekf_dt
  4. should_publish_diagnostics_with_counter: Verifies counter logic behavior
    • Verifies that it returns false when counter is below threshold
    • Verifies that it returns true and resets counter when counter reaches threshold
    • Verifies that it returns true and leaves remainder when counter exceeds threshold

Benefits

  1. Performance Improvement: Reducing diagnostics publishing frequency can decrease CPU usage and network bandwidth
  2. Flexibility: Users can adjust diagnostics publishing frequency according to their needs
  3. Backward Compatibility: Default value (0.0) maintains existing behavior (publish at every callback)
  4. Reliability: Ensures accurate behavior even during rosbag playback when timestamps may be irregular

Related links

The following pull-request must be merged simultaneously.
autowarefoundation/autoware_launch#1743

How was this PR tested?

  • the following replay test was done.
  1. Clone Autoware and do vcs import.
  2. Cherry-pick the changes of this pull-request and the related one above in each src repo.
  3. Build Autoware.
  4. Run unit tests colcon test --packages-select autoware_ekf_localizer and confirm the result colcon test-result --all --verbose --test-result-base build/autoware_ekf_localizer
  5. Set diagnostics_publish_frequency value to 1.0 in autoware_launch/config/localization/ekf_localizer.param.yaml
  6. launch and replay the sample rosbag and map
  7. Confirm the diagnostics publishing frequency of EKF localizer is 1.0 Hz.
    (Please verify using a script like this).

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

@Motsu-san Motsu-san 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 Jan 30, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jan 30, 2026

Thank you for contributing to the Autoware project!

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

Please ensure:

Motsu-san and others added 6 commits February 2, 2026 12:28
Signed-off-by: Motsu-san <83898149+Motsu-san@users.noreply.github.com>
Signed-off-by: Motsu-san <83898149+Motsu-san@users.noreply.github.com>
Signed-off-by: Motsu-san <83898149+Motsu-san@users.noreply.github.com>
Signed-off-by: Motsu-san <83898149+Motsu-san@users.noreply.github.com>
Signed-off-by: Motsu-san <83898149+Motsu-san@users.noreply.github.com>
@Motsu-san Motsu-san force-pushed the feat/adjustable_publishing_of_diagnostics_on_ekf branch from 57c74a0 to 98c329d Compare February 2, 2026 03:29
@Motsu-san Motsu-san added run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) and removed run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) labels Feb 2, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 2, 2026

Codecov Report

❌ Patch coverage is 86.36364% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.69%. Comparing base (a8a02d6) to head (98c329d).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
...ation/autoware_ekf_localizer/src/ekf_localizer.cpp 83.33% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #824      +/-   ##
==========================================
+ Coverage   50.66%   50.69%   +0.02%     
==========================================
  Files         348      348              
  Lines       22474    22493      +19     
  Branches    10032    10043      +11     
==========================================
+ Hits        11386    11402      +16     
  Misses       9993     9993              
- Partials     1095     1098       +3     
Flag Coverage Δ *Carryforward flag
daily-humble 50.44% <ø> (-0.01%) ⬇️ Carriedforward from a8a02d6
daily-jazzy 49.90% <ø> (-0.01%) ⬇️ Carriedforward from a8a02d6
differential-humble 55.91% <86.36%> (?)
total 50.16% <ø> (-0.01%) ⬇️ Carriedforward from a8a02d6
total-humble 50.45% <ø> (-0.01%) ⬇️ Carriedforward from a8a02d6
total-jazzy 49.93% <ø> (-0.01%) ⬇️ Carriedforward from a8a02d6

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

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

@Motsu-san Motsu-san marked this pull request as draft February 3, 2026 01:39
@Motsu-san
Copy link
Copy Markdown
Contributor Author

Motsu-san commented Feb 3, 2026

This pull-request was merged to #826.
So I changed this pull-request state "Draft" and will close if nothing happens.

@Motsu-san Motsu-san closed this Feb 16, 2026
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.

1 participant