@@ -137,7 +137,7 @@ bool AvoidanceModule::isExecutionRequested() const
137
137
bool AvoidanceModule::isExecutionReady () const
138
138
{
139
139
DEBUG_PRINT (" AVOIDANCE isExecutionReady" );
140
- return avoid_data_.safe && avoid_data_.comfortable ;
140
+ return avoid_data_.safe && avoid_data_.comfortable && avoid_data_. valid ;
141
141
}
142
142
143
143
bool AvoidanceModule::canTransitSuccessState ()
@@ -450,15 +450,14 @@ void AvoidanceModule::fillShiftLine(AvoidancePlanningData & data, DebugData & de
450
450
* STEP1: Create candidate shift lines.
451
451
* Merge rough shift lines, and extract new shift lines.
452
452
*/
453
- const auto processed_shift_lines = generator_.generate (data, debug);
453
+ data. new_shift_line = generator_.generate (data, debug);
454
454
455
455
/* *
456
456
* Step2: Validate new shift lines.
457
457
* Output new shift lines only when the avoidance path which is generated from them doesn't have
458
458
* huge offset from ego.
459
459
*/
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);
462
461
const auto found_new_sl = data.new_shift_line .size () > 0 ;
463
462
const auto registered = path_shifter.getShiftLines ().size () > 0 ;
464
463
data.found_avoidance_path = found_new_sl || registered;
@@ -494,17 +493,6 @@ void AvoidanceModule::fillShiftLine(AvoidancePlanningData & data, DebugData & de
494
493
void AvoidanceModule::fillEgoStatus (
495
494
AvoidancePlanningData & data, [[maybe_unused]] DebugData & debug) const
496
495
{
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
-
508
496
/* *
509
497
* Find the nearest object that should be avoid. When the ego follows reference path,
510
498
* if the both of following two conditions are satisfied, the module surely avoid the object.
0 commit comments