File tree 4 files changed +22
-2
lines changed
planning/behavior_path_planner
include/behavior_path_planner/utils/avoidance
src/scene_module/avoidance
4 files changed +22
-2
lines changed Original file line number Diff line number Diff line change 192
192
stop_buffer : 1.0 # [m]
193
193
194
194
policy :
195
+ # policy for rtc request. select "shift_line" or "maneuver".
196
+ # "shift_line": request approval for each shift line.
197
+ # "maneuver": request approval for avoidance maneuver (avoid + return).
198
+ approval : " shift_line"
195
199
# policy for vehicle slow down behavior. select "best_effort" or "reliable".
196
200
# "best_effort": slow down deceleration & jerk are limited by constraints.
197
201
# but there is a possibility that the vehicle can't stop in front of the vehicle.
Original file line number Diff line number Diff line change @@ -280,6 +280,9 @@ struct AvoidanceParameters
280
280
// policy
281
281
bool use_shorten_margin_immediately{false };
282
282
283
+ // policy
284
+ std::string policy_approval{" shift_line" };
285
+
283
286
// policy
284
287
std::string policy_deceleration{" best_effort" };
285
288
Original file line number Diff line number Diff line change @@ -85,6 +85,11 @@ bool isBestEffort(const std::string & policy)
85
85
{
86
86
return policy == " best_effort" ;
87
87
}
88
+
89
+ bool perManeuver (const std::string & policy)
90
+ {
91
+ return policy == " maneuver" ;
92
+ }
88
93
} // namespace
89
94
90
95
AvoidanceModule::AvoidanceModule (
@@ -2316,9 +2321,16 @@ AvoidLineArray AvoidanceModule::findNewShiftLine(const AvoidLineArray & candidat
2316
2321
break ;
2317
2322
}
2318
2323
2319
- if (! is_ignore_shift (candidate)) {
2320
- return get_subsequent_shift (i) ;
2324
+ if (is_ignore_shift (candidate)) {
2325
+ continue ;
2321
2326
}
2327
+
2328
+ if (perManeuver (parameters_->policy_approval )) {
2329
+ return candidates;
2330
+ }
2331
+
2332
+ const auto new_shift_lines = get_subsequent_shift (i);
2333
+ return new_shift_lines;
2322
2334
}
2323
2335
2324
2336
DEBUG_PRINT (" No new shift point exists." );
Original file line number Diff line number Diff line change @@ -218,6 +218,7 @@ AvoidanceModuleManager::AvoidanceModuleManager(
218
218
// policy
219
219
{
220
220
std::string ns = " avoidance.policy." ;
221
+ p.policy_approval = getOrDeclareParameter<std::string>(*node, ns + " approval" );
221
222
p.policy_deceleration = getOrDeclareParameter<std::string>(*node, ns + " deceleration" );
222
223
p.policy_lateral_margin = getOrDeclareParameter<std::string>(*node, ns + " lateral_margin" );
223
224
p.use_shorten_margin_immediately =
You can’t perform that action at this time.
0 commit comments