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: keep stop policy v0.11.2 #1125

Merged
merged 16 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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 @@ -192,6 +192,10 @@
stop_buffer: 1.0 # [m]

policy:
# policy for rtc request. select "shift_line" or "maneuver".
# "shift_line": request approval for each shift line.
# "maneuver": request approval for avoidance maneuver (avoid + return).
approval: "shift_line"
# policy for vehicle slow down behavior. select "best_effort" or "reliable".
# "best_effort": slow down deceleration & jerk are limited by constraints.
# but there is a possibility that the vehicle can't stop in front of the vehicle.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,9 @@ struct AvoidanceParameters
// policy
bool use_shorten_margin_immediately{false};

// policy
std::string policy_approval{"shift_line"};

// policy
std::string policy_deceleration{"best_effort"};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@ bool isBestEffort(const std::string & policy)
{
return policy == "best_effort";
}

bool perManeuver(const std::string & policy)
{
return policy == "maneuver";
}
} // namespace

AvoidanceModule::AvoidanceModule(
Expand Down Expand Up @@ -2316,9 +2321,16 @@ AvoidLineArray AvoidanceModule::findNewShiftLine(const AvoidLineArray & candidat
break;
}

if (!is_ignore_shift(candidate)) {
return get_subsequent_shift(i);
if (is_ignore_shift(candidate)) {
continue;
}

if (perManeuver(parameters_->policy_approval)) {
return candidates;
}

const auto new_shift_lines = get_subsequent_shift(i);
return new_shift_lines;
}

DEBUG_PRINT("No new shift point exists.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ AvoidanceModuleManager::AvoidanceModuleManager(
// policy
{
std::string ns = "avoidance.policy.";
p.policy_approval = getOrDeclareParameter<std::string>(*node, ns + "approval");
p.policy_deceleration = getOrDeclareParameter<std::string>(*node, ns + "deceleration");
p.policy_lateral_margin = getOrDeclareParameter<std::string>(*node, ns + "lateral_margin");
p.use_shorten_margin_immediately =
Expand Down
Loading