Skip to content

Commit 851de09

Browse files
authored
fix(avoidance): output invalid avoidance path with unsafe state (autowarefoundation#5689)
fix(avoidance): output invalid avoidance path Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
1 parent 41e5903 commit 851de09

File tree

1 file changed

+3
-15
lines changed
  • planning/behavior_path_avoidance_module/src

1 file changed

+3
-15
lines changed

planning/behavior_path_avoidance_module/src/scene.cpp

+3-15
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ bool AvoidanceModule::isExecutionRequested() const
137137
bool AvoidanceModule::isExecutionReady() const
138138
{
139139
DEBUG_PRINT("AVOIDANCE isExecutionReady");
140-
return avoid_data_.safe && avoid_data_.comfortable;
140+
return avoid_data_.safe && avoid_data_.comfortable && avoid_data_.valid;
141141
}
142142

143143
bool AvoidanceModule::canTransitSuccessState()
@@ -450,15 +450,14 @@ void AvoidanceModule::fillShiftLine(AvoidancePlanningData & data, DebugData & de
450450
* STEP1: Create candidate shift lines.
451451
* Merge rough shift lines, and extract new shift lines.
452452
*/
453-
const auto processed_shift_lines = generator_.generate(data, debug);
453+
data.new_shift_line = generator_.generate(data, debug);
454454

455455
/**
456456
* Step2: Validate new shift lines.
457457
* Output new shift lines only when the avoidance path which is generated from them doesn't have
458458
* huge offset from ego.
459459
*/
460-
data.valid = isValidShiftLine(processed_shift_lines, path_shifter);
461-
data.new_shift_line = data.valid ? processed_shift_lines : AvoidLineArray{};
460+
data.valid = isValidShiftLine(data.new_shift_line, path_shifter);
462461
const auto found_new_sl = data.new_shift_line.size() > 0;
463462
const auto registered = path_shifter.getShiftLines().size() > 0;
464463
data.found_avoidance_path = found_new_sl || registered;
@@ -494,17 +493,6 @@ void AvoidanceModule::fillShiftLine(AvoidancePlanningData & data, DebugData & de
494493
void AvoidanceModule::fillEgoStatus(
495494
AvoidancePlanningData & data, [[maybe_unused]] DebugData & debug) const
496495
{
497-
/**
498-
* TODO(someone): prevent meaningless stop point insertion in other way.
499-
* If the candidate shift line is invalid, manage all objects as unavoidable.
500-
*/
501-
if (!data.valid) {
502-
std::for_each(data.target_objects.begin(), data.target_objects.end(), [](auto & o) {
503-
o.is_avoidable = false;
504-
o.reason = "InvalidShiftLine";
505-
});
506-
}
507-
508496
/**
509497
* Find the nearest object that should be avoid. When the ego follows reference path,
510498
* if the both of following two conditions are satisfied, the module surely avoid the object.

0 commit comments

Comments
 (0)