Skip to content

refactor(diffusion_planner): move postprocessing logic from node to core#12162

Merged
SakodaShintaro merged 7 commits intoautowarefoundation:mainfrom
tier4:refactor/diffusion_planner/move_postprocessing_logic
Feb 25, 2026
Merged

refactor(diffusion_planner): move postprocessing logic from node to core#12162
SakodaShintaro merged 7 commits intoautowarefoundation:mainfrom
tier4:refactor/diffusion_planner/move_postprocessing_logic

Conversation

@SakodaShintaro
Copy link
Contributor

@SakodaShintaro SakodaShintaro commented Feb 24, 2026

Description

Move trajectory, candidate trajectories, predicted objects and turn indicator creation from publish_predictions in the node into DiffusionPlannerCore::create_planner_output, which returns a PlannerOutput struct containing all output messages. This makes the core logic testable independently of the ROS node. The node's on_timer now only handles publishing.

How was this PR tested?

  • planning simulator
  • logging_simulator

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

Signed-off-by: Shintaro Sakoda <shintaro.sakoda@tier4.jp>
@SakodaShintaro SakodaShintaro self-assigned this Feb 24, 2026
@SakodaShintaro SakodaShintaro added component:planning Route planning, decision-making, and navigation. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) labels Feb 24, 2026
@github-actions
Copy link

github-actions bot commented Feb 24, 2026

Thank you for contributing to the Autoware project!

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

Please ensure:

Signed-off-by: Shintaro Sakoda <shintaro.sakoda@tier4.jp>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors autoware_diffusion_planner to move postprocessing and message construction out of the ROS node and into DiffusionPlannerCore, enabling core logic to be tested independently from ROS publishing.

Changes:

  • Removed prediction postprocessing and output message assembly from DiffusionPlanner node timer callback.
  • Added DiffusionPlannerCore::create_planner_output() returning a PlannerOutput bundle (trajectory, candidate trajectories, predicted objects, turn indicator command).
  • Moved turn-indicator management state into the core and updated parameter handling accordingly.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.

File Description
planning/autoware_diffusion_planner/src/diffusion_planner_node.cpp Simplifies on_timer() to call core output builder and publish results.
planning/autoware_diffusion_planner/src/diffusion_planner_core.cpp Introduces create_planner_output() and migrates turn-indicator logic into core.
planning/autoware_diffusion_planner/include/autoware/diffusion_planner/diffusion_planner_node.hpp Removes node-side postprocessing API/member references (partially; doc cleanup needed).
planning/autoware_diffusion_planner/include/autoware/diffusion_planner/diffusion_planner_core.hpp Adds PlannerOutput struct and declares create_planner_output().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: Shintaro Sakoda <shintaro.sakoda@tier4.jp>
Signed-off-by: Shintaro Sakoda <shintaro.sakoda@tier4.jp>
@SakodaShintaro SakodaShintaro marked this pull request as ready for review February 24, 2026 09:44
@codecov
Copy link

codecov bot commented Feb 24, 2026

Codecov Report

❌ Patch coverage is 0% with 49 lines in your changes missing coverage. Please review.
✅ Project coverage is 18.17%. Comparing base (a2ee3ef) to head (18833a7).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...e_diffusion_planner/src/diffusion_planner_core.cpp 0.00% 37 Missing ⚠️
...e_diffusion_planner/src/diffusion_planner_node.cpp 0.00% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12162      +/-   ##
==========================================
+ Coverage   18.12%   18.17%   +0.05%     
==========================================
  Files        1842     1844       +2     
  Lines      126651   126834     +183     
  Branches    44419    44429      +10     
==========================================
+ Hits        22950    23048      +98     
- Misses      84582    84777     +195     
+ Partials    19119    19009     -110     
Flag Coverage Δ *Carryforward flag
daily 20.61% <ø> (ø) Carriedforward from 091d8b5
daily-cuda 18.14% <ø> (+<0.01%) ⬆️ Carriedforward from 091d8b5
differential-cuda 13.67% <0.00%> (?)
total-cuda 18.12% <ø> (+<0.01%) ⬆️ Carriedforward from 091d8b5

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

Copy link
Contributor

@go-sakayori go-sakayori left a comment

Choose a reason for hiding this comment

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

Seems some changes would be made in another PR, so LGTM!

Signed-off-by: Shintaro Sakoda <shintaro.sakoda@tier4.jp>
Signed-off-by: Shintaro Sakoda <shintaro.sakoda@tier4.jp>
Signed-off-by: Shintaro Sakoda <shintaro.sakoda@tier4.jp>
@SakodaShintaro SakodaShintaro merged commit c6e57de into autowarefoundation:main Feb 25, 2026
43 of 44 checks passed
@SakodaShintaro SakodaShintaro deleted the refactor/diffusion_planner/move_postprocessing_logic branch February 25, 2026 00:50
@github-project-automation github-project-automation bot moved this from To Triage to Done in Software Working Group Feb 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:planning Route planning, decision-making, and navigation. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci)

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants