@@ -65,7 +65,6 @@ AvoidanceModuleManager::AvoidanceModuleManager(
65
65
{
66
66
const auto get_object_param = [&](std::string && ns) {
67
67
ObjectParameter param{};
68
- param.is_target = getOrDeclareParameter<bool >(*node, ns + " is_target" );
69
68
param.execute_num = getOrDeclareParameter<int >(*node, ns + " execute_num" );
70
69
param.moving_speed_threshold =
71
70
getOrDeclareParameter<double >(*node, ns + " moving_speed_threshold" );
@@ -105,7 +104,24 @@ AvoidanceModuleManager::AvoidanceModuleManager(
105
104
106
105
// target filtering
107
106
{
107
+ const auto set_target_flag = [&](const uint8_t & object_type, const std::string & ns) {
108
+ if (p.object_parameters .count (object_type) == 0 ) {
109
+ return ;
110
+ }
111
+ p.object_parameters .at (object_type).is_avoidance_target =
112
+ getOrDeclareParameter<bool >(*node, ns);
113
+ };
114
+
108
115
std::string ns = " avoidance.target_filtering." ;
116
+ set_target_flag (ObjectClassification::CAR, ns + " target_type.car" );
117
+ set_target_flag (ObjectClassification::TRUCK, ns + " target_type.truck" );
118
+ set_target_flag (ObjectClassification::TRAILER, ns + " target_type.trailer" );
119
+ set_target_flag (ObjectClassification::BUS, ns + " target_type.bus" );
120
+ set_target_flag (ObjectClassification::PEDESTRIAN, ns + " target_type.pedestrian" );
121
+ set_target_flag (ObjectClassification::BICYCLE, ns + " target_type.bicycle" );
122
+ set_target_flag (ObjectClassification::MOTORCYCLE, ns + " target_type.motorcycle" );
123
+ set_target_flag (ObjectClassification::UNKNOWN, ns + " target_type.unknown" );
124
+
109
125
p.object_check_goal_distance =
110
126
getOrDeclareParameter<double >(*node, ns + " object_check_goal_distance" );
111
127
p.threshold_distance_object_is_on_center =
@@ -147,7 +163,24 @@ AvoidanceModuleManager::AvoidanceModuleManager(
147
163
148
164
// safety check general params
149
165
{
166
+ const auto set_target_flag = [&](const uint8_t & object_type, const std::string & ns) {
167
+ if (p.object_parameters .count (object_type) == 0 ) {
168
+ return ;
169
+ }
170
+ p.object_parameters .at (object_type).is_safety_check_target =
171
+ getOrDeclareParameter<bool >(*node, ns);
172
+ };
173
+
150
174
std::string ns = " avoidance.safety_check." ;
175
+ set_target_flag (ObjectClassification::CAR, ns + " target_type.car" );
176
+ set_target_flag (ObjectClassification::TRUCK, ns + " target_type.truck" );
177
+ set_target_flag (ObjectClassification::TRAILER, ns + " target_type.trailer" );
178
+ set_target_flag (ObjectClassification::BUS, ns + " target_type.bus" );
179
+ set_target_flag (ObjectClassification::PEDESTRIAN, ns + " target_type.pedestrian" );
180
+ set_target_flag (ObjectClassification::BICYCLE, ns + " target_type.bicycle" );
181
+ set_target_flag (ObjectClassification::MOTORCYCLE, ns + " target_type.motorcycle" );
182
+ set_target_flag (ObjectClassification::UNKNOWN, ns + " target_type.unknown" );
183
+
151
184
p.enable_safety_check = getOrDeclareParameter<bool >(*node, ns + " enable" );
152
185
p.check_current_lane = getOrDeclareParameter<bool >(*node, ns + " check_current_lane" );
153
186
p.check_shift_side_lane = getOrDeclareParameter<bool >(*node, ns + " check_shift_side_lane" );
@@ -346,7 +379,6 @@ void AvoidanceModuleManager::updateModuleParams(const std::vector<rclcpp::Parame
346
379
const auto update_object_param = [&p, ¶meters](
347
380
const auto & semantic, const std::string & ns) {
348
381
auto & config = p->object_parameters .at (semantic);
349
- updateParam<bool >(parameters, ns + " is_target" , config.is_target );
350
382
updateParam<double >(parameters, ns + " moving_speed_threshold" , config.moving_speed_threshold );
351
383
updateParam<double >(parameters, ns + " moving_time_threshold" , config.moving_time_threshold );
352
384
updateParam<double >(parameters, ns + " max_expand_ratio" , config.max_expand_ratio );
0 commit comments