Skip to content

Commit 3e4706e

Browse files
authored
feat(avoidance): keep stopping until all shift lines are registered (autowarefoundation#5658)
Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
1 parent 9df7819 commit 3e4706e

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

planning/behavior_path_planner/config/avoidance/avoidance.param.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,10 @@
231231
stop_buffer: 1.0 # [m]
232232

233233
policy:
234+
# policy for rtc request. select "per_shift_line" or "per_avoidance_maneuver".
235+
# "per_shift_line": request approval for each shift line.
236+
# "per_avoidance_maneuver": request approval for avoidance maneuver (avoid + return).
237+
make_approval_request: "per_shift_line"
234238
# policy for vehicle slow down behavior. select "best_effort" or "reliable".
235239
# "best_effort": slow down deceleration & jerk are limited by constraints.
236240
# but there is a possibility that the vehicle can't stop in front of the vehicle.

planning/behavior_path_planner/include/behavior_path_planner/utils/avoidance/avoidance_module_data.hpp

+3
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,9 @@ struct AvoidanceParameters
285285
// policy
286286
bool use_shorten_margin_immediately{false};
287287

288+
// policy
289+
std::string policy_approval{"per_shift_line"};
290+
288291
// policy
289292
std::string policy_deceleration{"best_effort"};
290293

planning/behavior_path_planner/src/scene_module/avoidance/manager.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,7 @@ AvoidanceModuleManager::AvoidanceModuleManager(
292292
// policy
293293
{
294294
std::string ns = "avoidance.policy.";
295+
p.policy_approval = getOrDeclareParameter<std::string>(*node, ns + "make_approval_request");
295296
p.policy_deceleration = getOrDeclareParameter<std::string>(*node, ns + "deceleration");
296297
p.policy_lateral_margin = getOrDeclareParameter<std::string>(*node, ns + "lateral_margin");
297298
p.use_shorten_margin_immediately =

planning/behavior_path_planner/src/utils/avoidance/shift_line_generator.cpp

+16-4
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ bool isBestEffort(const std::string & policy)
3535
return policy == "best_effort";
3636
}
3737

38+
bool perManeuver(const std::string & policy)
39+
{
40+
return policy == "per_avoidance_maneuver";
41+
}
42+
3843
AvoidLine merge(const AvoidLine & line1, const AvoidLine & line2, const UUID id)
3944
{
4045
AvoidLine ret{};
@@ -1213,11 +1218,18 @@ AvoidLineArray ShiftLineGenerator::findNewShiftLine(
12131218
break;
12141219
}
12151220

1216-
if (!is_ignore_shift(candidate)) {
1217-
const auto new_shift_lines = get_subsequent_shift(i);
1218-
debug.step4_new_shift_line = new_shift_lines;
1219-
return new_shift_lines;
1221+
if (is_ignore_shift(candidate)) {
1222+
continue;
12201223
}
1224+
1225+
if (perManeuver(parameters_->policy_approval)) {
1226+
debug.step4_new_shift_line = shift_lines;
1227+
return shift_lines;
1228+
}
1229+
1230+
const auto new_shift_lines = get_subsequent_shift(i);
1231+
debug.step4_new_shift_line = new_shift_lines;
1232+
return new_shift_lines;
12211233
}
12221234

12231235
return {};

0 commit comments

Comments
 (0)