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

fix(dynamic_avoidance): fix minor bugs and comment #6358

Merged
merged 3 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
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 @@ -345,8 +345,6 @@ class DynamicAvoidanceModule : public SceneModuleInterface

bool canTransitFailureState() override { return false; }

ModuleStatus setInitState() const override { return ModuleStatus::IDLE; }

bool isLabelTargetObstacle(const uint8_t label) const;
void updateTargetObjects();
LatFeasiblePaths generateLateralFeasiblePaths(
Expand Down
8 changes: 4 additions & 4 deletions planning/behavior_path_dynamic_avoidance_module/src/scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1066,11 +1066,11 @@ MinMaxValue DynamicAvoidanceModule::calcMinMaxLongitudinalOffsetToAvoid(
// calculate bound start and end length
const double start_length_to_avoid = [&]() {
if (obj_vel < parameters_->max_stopped_object_vel) {
// The ego and object are the same directional or the object is parked.
// The ego and object are the opposite directional or the object is parked.
return std::min(time_while_collision.time_to_start_collision, 8.0) * std::abs(obj_vel) +
std::abs(relative_velocity) * parameters_->start_duration_to_avoid_oncoming_object;
}
// The ego and object are the opposite directional.
// The ego and object are the same directional.
const double obj_acc = -0.5;
const double decel_time = 1.0;
const double obj_moving_dist =
Expand All @@ -1082,10 +1082,10 @@ MinMaxValue DynamicAvoidanceModule::calcMinMaxLongitudinalOffsetToAvoid(
}();
const double end_length_to_avoid = [&]() {
if (obj_vel < parameters_->max_stopped_object_vel) {
// The ego and object are the same directional or the object is parked.
// The ego and object are the opposite directional or the object is parked.
return std::abs(relative_velocity) * parameters_->end_duration_to_avoid_oncoming_object;
}
// The ego and object are the opposite directional.
// The ego and object are the same directional.
return std::min(time_while_collision.time_to_end_collision, 3.0) * obj_vel +
std::abs(relative_velocity) * parameters_->end_duration_to_avoid_overtaking_object;
}();
Expand Down
Loading