Skip to content

Commit

Permalink
fix(lane_change): parameterize velocity scale for collision check (au…
Browse files Browse the repository at this point in the history
…towarefoundation#3906)

Signed-off-by: Muhammad Zulfaqar Azmi <[email protected]>
  • Loading branch information
zulfaqar-azmi-t4 authored Jun 6, 2023
1 parent 62850d0 commit 922ec90
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

lateral_distance_max_threshold: 2.0
longitudinal_distance_min_threshold: 3.0
longitudinal_velocity_delta_time: 0.8 # [s]

expected_front_deceleration: -1.0
expected_rear_deceleration: -1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ struct BehaviorPathPlannerParameters
// collision check
double lateral_distance_max_threshold;
double longitudinal_distance_min_threshold;
double longitudinal_velocity_delta_time;

double expected_front_deceleration; // brake parameter under normal lane change
double expected_rear_deceleration; // brake parameter under normal lane change
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,8 @@ BehaviorPathPlannerParameters BehaviorPathPlannerNode::getCommonParam()
p.lateral_distance_max_threshold = declare_parameter<double>("lateral_distance_max_threshold");
p.longitudinal_distance_min_threshold =
declare_parameter<double>("longitudinal_distance_min_threshold");
p.longitudinal_velocity_delta_time =
declare_parameter<double>("longitudinal_velocity_delta_time");

p.expected_front_deceleration = declare_parameter<double>("expected_front_deceleration");
p.expected_rear_deceleration = declare_parameter<double>("expected_rear_deceleration");
Expand Down
3 changes: 1 addition & 2 deletions planning/behavior_path_planner/src/utils/safety_check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,7 @@ double calcMinimumLongitudinalLength(
{
const double & lon_threshold = params.longitudinal_distance_min_threshold;
const auto max_vel = std::max(front_object_velocity, rear_object_velocity);
constexpr auto scale = 0.8;
return scale * std::abs(max_vel) + lon_threshold;
return params.longitudinal_velocity_delta_time * std::abs(max_vel) + lon_threshold;
}

bool isSafeInLaneletCollisionCheck(
Expand Down

0 comments on commit 922ec90

Please sign in to comment.