Skip to content

Commit 66dc9ae

Browse files
committed
fix(trajectory_validator): fallback shape filters without base value
1 parent 80ab686 commit 66dc9ae

4 files changed

Lines changed: 30 additions & 17 deletions

File tree

planning/autoware_trajectory_validator/param/parameter_struct.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ validator:
9696
}
9797
unknown: &drac_ea
9898
type: string_array
99-
default_value: [base]
99+
default_value: []
100100
description: DRAC target Shape types per class. Supported values are bbox and polygon. Use [""] to disable the class.
101101
read_only: false
102102
car: *drac_ea
@@ -280,7 +280,7 @@ validator:
280280
}
281281
unknown: &rss_ea
282282
type: string_array
283-
default_value: [base]
283+
default_value: []
284284
description: RSS target Shape types per class. Supported values are bbox and polygon. Use [""] to disable the class.
285285
read_only: false
286286
car: *rss_ea

planning/autoware_trajectory_validator/schema/trajectory_validator.schema.json

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,17 @@
2828
"properties": {
2929
"base": {
3030
"type": "array",
31-
"minItems": 1,
32-
"items": { "enum": ["bbox", "polygon"] },
31+
"oneOf": [
32+
{
33+
"minItems": 1,
34+
"items": { "enum": ["bbox", "polygon"] }
35+
},
36+
{
37+
"minItems": 1,
38+
"maxItems": 1,
39+
"items": { "const": "" }
40+
}
41+
],
3342
"default": ["bbox"]
3443
},
3544
"unknown": { "$ref": "#/definitions/target_shapes_override" },
@@ -70,21 +79,19 @@
7079
},
7180
"target_shapes_override": {
7281
"type": "array",
73-
"default": ["base"],
82+
"default": [],
7483
"oneOf": [
7584
{
76-
"minItems": 1,
77-
"items": { "enum": ["bbox", "polygon"] }
85+
"maxItems": 0
7886
},
7987
{
8088
"minItems": 1,
81-
"maxItems": 1,
82-
"items": { "const": "" }
89+
"items": { "enum": ["bbox", "polygon"] }
8390
},
8491
{
8592
"minItems": 1,
8693
"maxItems": 1,
87-
"items": { "const": "base" }
94+
"items": { "const": "" }
8895
}
8996
]
9097
},
@@ -93,8 +100,17 @@
93100
"properties": {
94101
"base": {
95102
"type": "array",
96-
"minItems": 1,
97-
"items": { "enum": ["bbox", "polygon"] },
103+
"oneOf": [
104+
{
105+
"minItems": 1,
106+
"items": { "enum": ["bbox", "polygon"] }
107+
},
108+
{
109+
"minItems": 1,
110+
"maxItems": 1,
111+
"items": { "const": "" }
112+
}
113+
],
98114
"default": ["bbox", "polygon"]
99115
}
100116
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void log_target_shape_type_params(
3737
const std::string_view assessment_name, const std::string_view class_name,
3838
const TargetShapeTypeParams & target_shape_types)
3939
{
40-
RCLCPP_DEBUG(
40+
RCLCPP_INFO(
4141
rclcpp::get_logger("CollisionCheckFilter"),
4242
"%s collision target shape types: class=%s, bbox=%s, polygon=%s",
4343
std::string(assessment_name).c_str(), std::string(class_name).c_str(),

planning/autoware_trajectory_validator/src/filters/safety/collision_check_filter/parameter.hpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,7 @@ OutT extract_labeled_param(const ParamStruct & params_struct, const std::string_
154154
} else if constexpr (std::is_same_v<OutT, std::string>) {
155155
return static_cast<OutT>(label_value.empty() ? params_struct.base : label_value);
156156
} else if constexpr (std::is_same_v<OutT, std::vector<std::string>>) {
157-
return static_cast<OutT>(
158-
label_value.size() == 1U && label_value.front() == kCollisionCheckParamBaseKey
159-
? params_struct.base
160-
: label_value);
157+
return static_cast<OutT>(label_value.empty() ? params_struct.base : label_value);
161158
} else {
162159
return static_cast<OutT>(label_value);
163160
}

0 commit comments

Comments
 (0)