Skip to content

feat(trajectory_validator): filter collision objects by shape - #3248

Merged
satoshi-ota merged 7 commits into
feat/v0.64/e2efrom
feat/trajectory-validator-shape-filter
Jul 30, 2026
Merged

feat(trajectory_validator): filter collision objects by shape#3248
satoshi-ota merged 7 commits into
feat/v0.64/e2efrom
feat/trajectory-validator-shape-filter

Conversation

@satoshi-ota

@satoshi-ota satoshi-ota commented Jul 27, 2026

Copy link
Copy Markdown

Summary

This PR adds shape-type based filtering to the trajectory validator collision check filter.

Objects can now be included or excluded from DRAC/RSS collision assessment per object class based on autoware_perception_msgs/msg/Shape.type.

Changes

  • Add per-class collision target shape parameters for DRAC and RSS.
    • Supported values: bbox, polygon
    • Disabled classes are represented as [""] because ROS 2 parameter YAML cannot infer the type of [].
  • Parse the string-array parameters into C++ flags:
    • bbox=true/false
    • polygon=true/false
  • Set defaults:
    • DRAC base: [bbox]
    • RSS base: [bbox, polygon]
  • Allow class-specific overrides through validator.param.yaml.
  • Skip unsupported Shape.type values without throwing, and emit a warning instead.
  • Update the parameter schema to allow [base] fallback and [""] disabled-class configuration.

Verification

TEST CASE1

    collision_check:
      ...
        enable_assessment:
          base: [bbox]
          unknown: [polygon]
          over_drivable: [bbox, polygon]
          under_drivable: [""]
[autoware_trajectory_selector_node-27] [INFO 1785195520.512731333] [CollisionCheckFilter]: DRAC collision target shape types: class=animal, bbox=true, polygon=false                                                                                                                                                                                                                                                             
[autoware_trajectory_selector_node-27] [INFO 1785195520.512750638] [CollisionCheckFilter]: DRAC collision target shape types: class=base, bbox=true, polygon=false                                                                                                                                                                                                                                                               
[autoware_trajectory_selector_node-27] [INFO 1785195520.512753707] [CollisionCheckFilter]: DRAC collision target shape types: class=bicycle, bbox=true, polygon=false                                                                                                                                                                                                                                                            
[autoware_trajectory_selector_node-27] [INFO 1785195520.512756318] [CollisionCheckFilter]: DRAC collision target shape types: class=bus, bbox=true, polygon=false                                                                                                                                                                                                                                                                
[autoware_trajectory_selector_node-27] [INFO 1785195520.512758732] [CollisionCheckFilter]: DRAC collision target shape types: class=car, bbox=true, polygon=false                                                                                                                                                                                                                                                                
[autoware_trajectory_selector_node-27] [INFO 1785195520.512761120] [CollisionCheckFilter]: DRAC collision target shape types: class=hazard, bbox=true, polygon=false                                                                                                                                                                                                                                                             
[autoware_trajectory_selector_node-27] [INFO 1785195520.512763758] [CollisionCheckFilter]: DRAC collision target shape types: class=motorcycle, bbox=true, polygon=false                                                                                                                                                                                                                                                         
[autoware_trajectory_selector_node-27] [INFO 1785195520.512765890] [CollisionCheckFilter]: DRAC collision target shape types: class=over_drivable, bbox=true, polygon=true                                                                                                                                                                                                                                                       
[autoware_trajectory_selector_node-27] [INFO 1785195520.512768346] [CollisionCheckFilter]: DRAC collision target shape types: class=pedestrian, bbox=true, polygon=false                                                                                                                                                                                                                                                         
[autoware_trajectory_selector_node-27] [INFO 1785195520.512770540] [CollisionCheckFilter]: DRAC collision target shape types: class=trailer, bbox=true, polygon=false                                                                                                                                                                                                                                                            
[autoware_trajectory_selector_node-27] [INFO 1785195520.512773122] [CollisionCheckFilter]: DRAC collision target shape types: class=truck, bbox=true, polygon=false                                                                                                                                                                                                                                                              
[autoware_trajectory_selector_node-27] [INFO 1785195520.512775617] [CollisionCheckFilter]: DRAC collision target shape types: class=under_drivable, bbox=false, polygon=false                                                                                                                                                                                                                                                    
[autoware_trajectory_selector_node-27] [INFO 1785195520.512778498] [CollisionCheckFilter]: DRAC collision target shape types: class=unknown, bbox=false, polygon=true

TEST CASE2

    collision_check:
      ...
        enable_assessment:
          base: [""]
          unknown: [polygon]
          over_drivable: [bbox, polygon]
          under_drivable: [bbox]
[autoware_trajectory_selector_node-27] [INFO 1785195670.984174633] [CollisionCheckFilter]: DRAC collision target shape types: class=animal, bbox=false, polygon=false                                                                                                                                                                                                                                                            
[autoware_trajectory_selector_node-27] [INFO 1785195670.984179530] [CollisionCheckFilter]: DRAC collision target shape types: class=base, bbox=false, polygon=false                                                                                                                                                                                                                                                              
[autoware_trajectory_selector_node-27] [INFO 1785195670.984182139] [CollisionCheckFilter]: DRAC collision target shape types: class=bicycle, bbox=false, polygon=false                                                                                                                                                                                                                                                           
[autoware_trajectory_selector_node-27] [INFO 1785195670.984184549] [CollisionCheckFilter]: DRAC collision target shape types: class=bus, bbox=false, polygon=false                                                                                                                                                                                                                                                               
[autoware_trajectory_selector_node-27] [INFO 1785195670.984186862] [CollisionCheckFilter]: DRAC collision target shape types: class=car, bbox=false, polygon=false                                                                                                                                                                                                                                                               
[autoware_trajectory_selector_node-27] [INFO 1785195670.984189228] [CollisionCheckFilter]: DRAC collision target shape types: class=hazard, bbox=false, polygon=false                                                                                                                                                                                                                                                            
[autoware_trajectory_selector_node-27] [INFO 1785195670.984191625] [CollisionCheckFilter]: DRAC collision target shape types: class=motorcycle, bbox=false, polygon=false                                                                                                                                                                                                                                                        
[autoware_trajectory_selector_node-27] [INFO 1785195670.984194084] [CollisionCheckFilter]: DRAC collision target shape types: class=over_drivable, bbox=true, polygon=true                                                                                                                                                                                                                                                       
[autoware_trajectory_selector_node-27] [INFO 1785195670.984196284] [CollisionCheckFilter]: DRAC collision target shape types: class=pedestrian, bbox=false, polygon=false                                                                                                                                                                                                                                                        
[autoware_trajectory_selector_node-27] [INFO 1785195670.984198620] [CollisionCheckFilter]: DRAC collision target shape types: class=trailer, bbox=false, polygon=false                                                                                                                                                                                                                                                           
[autoware_trajectory_selector_node-27] [INFO 1785195670.984200966] [CollisionCheckFilter]: DRAC collision target shape types: class=truck, bbox=false, polygon=false                                                                                                                                                                                                                                                             
[autoware_trajectory_selector_node-27] [INFO 1785195670.984203368] [CollisionCheckFilter]: DRAC collision target shape types: class=under_drivable, bbox=true, polygon=false                                                                                                                                                                                                                                                     
[autoware_trajectory_selector_node-27] [INFO 1785195670.984205807] [CollisionCheckFilter]: DRAC collision target shape types: class=unknown, bbox=false, polygon=true  

TEST CASE3

    collision_check:
      ...
        enable_assessment:
          base: [bbox, polygon]
          unknown: [polygon]
          pedestrian: [""]
          under_drivable: [bbox]
[autoware_trajectory_selector_node-27] [INFO 1785195899.934402129] [CollisionCheckFilter]: DRAC collision target shape types: class=animal, bbox=true, polygon=true                                                                                                                                                                                                                                                              
[autoware_trajectory_selector_node-27] [INFO 1785195899.934407557] [CollisionCheckFilter]: DRAC collision target shape types: class=base, bbox=true, polygon=true                                                                                                                                                                                                                                                                
[autoware_trajectory_selector_node-27] [INFO 1785195899.934410266] [CollisionCheckFilter]: DRAC collision target shape types: class=bicycle, bbox=true, polygon=true                                                                                                                                                                                                                                                             
[autoware_trajectory_selector_node-27] [INFO 1785195899.934412594] [CollisionCheckFilter]: DRAC collision target shape types: class=bus, bbox=true, polygon=true                                                                                                                                                                                                                                                                 
[autoware_trajectory_selector_node-27] [INFO 1785195899.934414677] [CollisionCheckFilter]: DRAC collision target shape types: class=car, bbox=true, polygon=true                                                                                                                                                                                                                                                                 
[autoware_trajectory_selector_node-27] [INFO 1785195899.934417140] [CollisionCheckFilter]: DRAC collision target shape types: class=hazard, bbox=true, polygon=true                                                                                                                                                                                                                                                              
[autoware_trajectory_selector_node-27] [INFO 1785195899.934419535] [CollisionCheckFilter]: DRAC collision target shape types: class=motorcycle, bbox=true, polygon=true                                                                                                                                                                                                                                                          
[autoware_trajectory_selector_node-27] [INFO 1785195899.934422090] [CollisionCheckFilter]: DRAC collision target shape types: class=over_drivable, bbox=true, polygon=true                                                                                                                                                                                                                                                       
[autoware_trajectory_selector_node-27] [INFO 1785195899.934424363] [CollisionCheckFilter]: DRAC collision target shape types: class=pedestrian, bbox=false, polygon=false                                                                                                                                                                                                                                                        
[autoware_trajectory_selector_node-27] [INFO 1785195899.934427018] [CollisionCheckFilter]: DRAC collision target shape types: class=trailer, bbox=true, polygon=true                                                                                                                                                                                                                                                             
[autoware_trajectory_selector_node-27] [INFO 1785195899.934429637] [CollisionCheckFilter]: DRAC collision target shape types: class=truck, bbox=true, polygon=true                                                                                                                                                                                                                                                               
[autoware_trajectory_selector_node-27] [INFO 1785195899.934432234] [CollisionCheckFilter]: DRAC collision target shape types: class=under_drivable, bbox=true, polygon=false                                                                                                                                                                                                                                                     
[autoware_trajectory_selector_node-27] [INFO 1785195899.934434777] [CollisionCheckFilter]: DRAC collision target shape types: class=unknown, bbox=false, polygon=true

@github-actions

Copy link
Copy Markdown

@satoshi-ota Thank you for contributing to TIER IV E2E branch! Edit the checklist below and check the boxes as you complete the items.

Things to check before merging

Please check the following points before merging:

  • Write a brief description of this PR that can be understood by coding-agents.
  • Contact the branch manager on when the PR will be tested on vehicle.
  • Recommend to use Squash and Merge to merge the PR.
  • Report in #team-product-dev channel on the contents of the PR. @ branch manager.

After merging

Please check the following points after merging:

  • Wait for the automatic hash synchronization, which will automatically create a PR to update the hash, you should check the PR and merge it.

@tier4-autoware-public-bot tier4-autoware-public-bot Bot added beta/v0.64 Base branch: beta/v0.64 diffusion_planner Product: diffusion_planner labels Jul 27, 2026
@satoshi-ota
satoshi-ota force-pushed the feat/trajectory-validator-shape-filter branch 4 times, most recently from 2514af5 to cdef173 Compare July 27, 2026 05:36
@satoshi-ota
satoshi-ota marked this pull request as ready for review July 27, 2026 05:43
@satoshi-ota
satoshi-ota force-pushed the feat/trajectory-validator-shape-filter branch 2 times, most recently from 6d9848b to ab88aaa Compare July 28, 2026 05:31

@yuki-takagi-66 yuki-takagi-66 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

動いてはいることは理解できましたが、パースアルゴリズムが紛らわしすぎるように思います。
何かしら設計変更をお願いしたいです。

return static_cast<OutT>(label_value.empty() ? params_struct.base : label_value);
} else if constexpr (std::is_same_v<OutT, std::vector<std::string>>) {
return static_cast<OutT>(
label_value.size() == 1U && label_value.front() == kCollisionCheckParamBaseKey

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

”base”はkey stringです。value側にいれるものではありません。
相当confusingです。

},
"target_shapes_override": {
"type": "array",
"default": ["base"],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

”base”はkey stringです。value側にいれるものではありません。
相当confusingです。

@yuki-takagi-66 yuki-takagi-66 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

メモ:空文字と空配列とで、「対象shape_typeなし」と「有効値なし」とを区別している

@mergify

mergify Bot commented Jul 29, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@satoshi-ota
satoshi-ota force-pushed the feat/trajectory-validator-shape-filter branch from 9cdb387 to 66dc9ae Compare July 29, 2026 08:12
@satoshi-ota
satoshi-ota force-pushed the feat/trajectory-validator-shape-filter branch from 66dc9ae to 69b1fe5 Compare July 29, 2026 12:29
@satoshi-ota satoshi-ota added run:build-and-test-differential After beta/v0.41 and removed run:build-and-test-differential After beta/v0.41 labels Jul 29, 2026
Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
@satoshi-ota satoshi-ota added run:build-and-test-differential After beta/v0.41 and removed run:build-and-test-differential After beta/v0.41 labels Jul 29, 2026
@sonarqubecloud

Copy link
Copy Markdown

@satoshi-ota
satoshi-ota merged commit 7423d4d into feat/v0.64/e2e Jul 30, 2026
42 of 46 checks passed
@satoshi-ota
satoshi-ota deleted the feat/trajectory-validator-shape-filter branch July 30, 2026 04:19
tier4-autoware-public-bot Bot pushed a commit to tier4/autoware_universe_planning that referenced this pull request Jul 30, 2026
…autoware_universe#3248)

* feat(trajectory_validator): filter collision objects by shape

* fix(trajectory_validator): filter target shapes during assessment

* chore(trajectory_validator): set collision shape defaults in config

* refactor(trajectory_validator): pass shape type to target filter

* fix(trajectory_validator): fallback shape filters to base

* fix(trajectory_validator): fallback shape filters without base value

* fix: pre commit

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>

---------

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

beta/v0.64 Base branch: beta/v0.64 diffusion_planner Product: diffusion_planner run:build-and-test-differential After beta/v0.41

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants