Skip to content

Commit 6d9848b

Browse files
committed
fix(trajectory_validator): fallback shape filters to base
1 parent 848a387 commit 6d9848b

3 files changed

Lines changed: 36 additions & 4 deletions

File tree

planning/autoware_trajectory_validator/param/parameter_struct.yaml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,17 @@ validator:
8888
read_only: false
8989
enable_assessment:
9090
base:
91-
&drac_ea {
91+
&drac_ea_base {
9292
type: string_array,
9393
default_value: [bbox],
9494
description: 'DRAC target Shape types per class. Supported values are bbox and polygon. Use [""] to disable the class.',
9595
read_only: false,
9696
}
97-
unknown: *drac_ea
97+
unknown: &drac_ea
98+
type: string_array
99+
default_value: [base]
100+
description: DRAC target Shape types per class. Supported values are bbox and polygon. Use [""] to disable the class.
101+
read_only: false
98102
car: *drac_ea
99103
truck: *drac_ea
100104
bus: *drac_ea
@@ -268,13 +272,17 @@ validator:
268272
rss:
269273
enable_assessment:
270274
base:
271-
&rss_ea {
275+
&rss_ea_base {
272276
type: string_array,
273277
default_value: [bbox, polygon],
274278
description: 'RSS target Shape types per class. Supported values are bbox and polygon. Use [""] to disable the class.',
275279
read_only: false,
276280
}
277-
unknown: *rss_ea
281+
unknown: &rss_ea
282+
type: string_array
283+
default_value: [base]
284+
description: RSS target Shape types per class. Supported values are bbox and polygon. Use [""] to disable the class.
285+
read_only: false
278286
car: *rss_ea
279287
truck: *rss_ea
280288
bus: *rss_ea

planning/autoware_trajectory_validator/schema/trajectory_validator.schema.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
},
7171
"target_shapes_override": {
7272
"type": "array",
73+
"default": ["base"],
7374
"oneOf": [
7475
{
7576
"minItems": 1,

planning/autoware_trajectory_validator/src/filters/safety/collision_check_filter/collision_check_filter.cpp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
#include "assessment.hpp"
1818

19+
#include <rclcpp/logging.hpp>
20+
1921
#include <fmt/core.h>
2022

2123
#include <algorithm>
@@ -29,6 +31,20 @@
2931

3032
namespace autoware::trajectory_validator::plugin::safety
3133
{
34+
namespace
35+
{
36+
void log_target_shape_type_params(
37+
const std::string_view assessment_name, const std::string_view class_name,
38+
const TargetShapeTypeParams & target_shape_types)
39+
{
40+
RCLCPP_DEBUG(
41+
rclcpp::get_logger("CollisionCheckFilter"),
42+
"%s collision target shape types: class=%s, bbox=%s, polygon=%s",
43+
std::string(assessment_name).c_str(), std::string(class_name).c_str(),
44+
target_shape_types.bbox ? "true" : "false", target_shape_types.polygon ? "true" : "false");
45+
}
46+
} // namespace
47+
3248
void CollisionCheckFilter::update_parameters(const validator::Params & node_params)
3349
{
3450
global_params_ = GlobalParams(node_params.collision_check.global_setting);
@@ -38,6 +54,13 @@ void CollisionCheckFilter::update_parameters(const validator::Params & node_para
3854

3955
drac_param_map_ = create_param_map_per_object<DracParams>(node_params);
4056
rss_param_map_ = create_param_map_per_object<RssParams>(node_params);
57+
58+
for (const auto & [class_name, params] : drac_param_map_) {
59+
log_target_shape_type_params("DRAC", class_name, params.target_shape_types);
60+
}
61+
for (const auto & [class_name, params] : rss_param_map_) {
62+
log_target_shape_type_params("RSS", class_name, params.target_shape_types);
63+
}
4164
}
4265

4366
void CollisionCheckFilter::clear_detection_times()

0 commit comments

Comments
 (0)