Skip to content

Commit

Permalink
fix check algorithm
Browse files Browse the repository at this point in the history
Signed-off-by: ismetatabay <[email protected]>
  • Loading branch information
ismetatabay committed Nov 24, 2022
1 parent 83256a8 commit 9168592
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,9 @@ class AvoidanceModule : public SceneModuleInterface
void updateRegisteredRawShiftLines();

// -- for state management --
bool is_avoidance_maneuver_starts;
bool isAvoidanceManeuverRunning();
bool isAvoidancePlanRunning() const;
bool isAvoidanceManeuverRunning() const;

// -- for pre-processing --
void initVariables();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,13 @@ bool AvoidanceModule::isAvoidancePlanRunning() const
const bool has_shift_line = (path_shifter_.getShiftLinesSize() > 0);
return has_base_offset || has_shift_line;
}
bool AvoidanceModule::isAvoidanceManeuverRunning() const
bool AvoidanceModule::isAvoidanceManeuverRunning()
{
const auto path_idx = avoidance_data_.ego_closest_path_index;

for (const auto & al : registered_raw_shift_lines_) {
if (path_idx > al.start_idx || registered_raw_shift_lines_.size() == 1) {
if (path_idx > al.start_idx || is_avoidance_maneuver_starts) {
is_avoidance_maneuver_starts = true;
return true;
}
}
Expand Down Expand Up @@ -2682,6 +2683,7 @@ void AvoidanceModule::initVariables()
registered_raw_shift_lines_ = {};
current_raw_shift_lines_ = {};
original_unique_id = 0;
is_avoidance_maneuver_starts = false;
}

bool AvoidanceModule::isTargetObjectType(const PredictedObject & object) const
Expand Down

0 comments on commit 9168592

Please sign in to comment.