Skip to content

Commit 202a178

Browse files
saka1-ssatoshi-ota
andauthored
feat: keep stop policy v0.11.2 (reopen) (#1246)
* feat(avoidance): keep stopping until all shift lines are registered Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com> * revert refactoring due to cherry-pick --------- Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com> Co-authored-by: satoshi-ota <satoshi.ota928@gmail.com>
1 parent 4d368b9 commit 202a178

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

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

+4
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@
192192
stop_buffer: 1.0 # [m]
193193

194194
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"
195199
# policy for vehicle slow down behavior. select "best_effort" or "reliable".
196200
# "best_effort": slow down deceleration & jerk are limited by constraints.
197201
# 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
@@ -280,6 +280,9 @@ struct AvoidanceParameters
280280
// policy
281281
bool use_shorten_margin_immediately{false};
282282

283+
// policy
284+
std::string policy_approval{"shift_line"};
285+
283286
// policy
284287
std::string policy_deceleration{"best_effort"};
285288

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

+14-2
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ bool isBestEffort(const std::string & policy)
8585
{
8686
return policy == "best_effort";
8787
}
88+
89+
bool perManeuver(const std::string & policy)
90+
{
91+
return policy == "maneuver";
92+
}
8893
} // namespace
8994

9095
AvoidanceModule::AvoidanceModule(
@@ -2316,9 +2321,16 @@ AvoidLineArray AvoidanceModule::findNewShiftLine(const AvoidLineArray & candidat
23162321
break;
23172322
}
23182323

2319-
if (!is_ignore_shift(candidate)) {
2320-
return get_subsequent_shift(i);
2324+
if (is_ignore_shift(candidate)) {
2325+
continue;
23212326
}
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;
23222334
}
23232335

23242336
DEBUG_PRINT("No new shift point exists.");

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

+1
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ AvoidanceModuleManager::AvoidanceModuleManager(
218218
// policy
219219
{
220220
std::string ns = "avoidance.policy.";
221+
p.policy_approval = getOrDeclareParameter<std::string>(*node, ns + "approval");
221222
p.policy_deceleration = getOrDeclareParameter<std::string>(*node, ns + "deceleration");
222223
p.policy_lateral_margin = getOrDeclareParameter<std::string>(*node, ns + "lateral_margin");
223224
p.use_shorten_margin_immediately =

0 commit comments

Comments
 (0)