Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(static_obstacle_avoidance): return original lane automatically #10231

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,29 @@ void StaticObstacleAvoidanceModule::fillEgoStatus(
return;
}

/**
* If the yield maneuver is disabled, use unapproved_new_sl for avoidance path generation even if
* the shift line is unsafe.
*/
if (!parameters_->enable_yield_maneuver) {
data.yield_required = false;
data.safe_shift_line = data.new_shift_line;
return;
}

/**
* TODO(Satoshi OTA) Think yield maneuver in the middle of avoidance.
* Even if it is determined that a yield is necessary, the yield maneuver is not executed
* if the avoidance has already been initiated.
*/
if (!can_yield_maneuver) {
data.safe = true; // overwrite safety judge.
data.yield_required = false;
data.safe_shift_line = data.new_shift_line;
RCLCPP_WARN_THROTTLE(getLogger(), *clock_, 500, "unsafe. but could not transit yield status.");
return;
}

auto candidate_sl_force_activated = [&](const std::string & direction) {
// If statement to avoid unnecessary warning occurring from isForceActivated function
if (candidate_uuid_ == uuid_map_.at(direction)) {
Expand Down Expand Up @@ -649,29 +672,6 @@ void StaticObstacleAvoidanceModule::fillEgoStatus(
return;
}

/**
* If the yield maneuver is disabled, use unapproved_new_sl for avoidance path generation even if
* the shift line is unsafe.
*/
if (!parameters_->enable_yield_maneuver) {
data.yield_required = false;
data.safe_shift_line = data.new_shift_line;
return;
}

/**
* TODO(Satoshi OTA) Think yield maneuver in the middle of avoidance.
* Even if it is determined that a yield is necessary, the yield maneuver is not executed
* if the avoidance has already been initiated.
*/
if (!can_yield_maneuver) {
data.safe = true; // overwrite safety judge.
data.yield_required = false;
data.safe_shift_line = data.new_shift_line;
RCLCPP_WARN_THROTTLE(getLogger(), *clock_, 500, "unsafe. but could not transit yield status.");
return;
}

/**
* Transit yield maneuver. Clear shift lines and output yield path.
*/
Expand Down
Loading