refactor(diffusion_planner): move postprocessing logic from node to core#12162
Conversation
Signed-off-by: Shintaro Sakoda <shintaro.sakoda@tier4.jp>
|
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>
There was a problem hiding this comment.
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
DiffusionPlannernode timer callback. - Added
DiffusionPlannerCore::create_planner_output()returning aPlannerOutputbundle (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.
planning/autoware_diffusion_planner/src/diffusion_planner_node.cpp
Outdated
Show resolved
Hide resolved
...ing/autoware_diffusion_planner/include/autoware/diffusion_planner/diffusion_planner_node.hpp
Show resolved
Hide resolved
Signed-off-by: Shintaro Sakoda <shintaro.sakoda@tier4.jp>
Signed-off-by: Shintaro Sakoda <shintaro.sakoda@tier4.jp>
Codecov Report❌ Patch coverage is
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
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
go-sakayori
left a comment
There was a problem hiding this comment.
Seems some changes would be made in another PR, so LGTM!
planning/autoware_diffusion_planner/src/diffusion_planner_node.cpp
Outdated
Show resolved
Hide resolved
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>
c6e57de
into
autowarefoundation:main
Description
Move trajectory, candidate trajectories, predicted objects and turn indicator creation from
publish_predictionsin the node intoDiffusionPlannerCore::create_planner_output, which returns aPlannerOutputstruct containing all output messages. This makes the core logic testable independently of the ROS node. The node'son_timernow only handles publishing.How was this PR tested?
Notes for reviewers
None.
Interface changes
None.
Effects on system behavior
None.