-
Notifications
You must be signed in to change notification settings - Fork 683
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(time-based-safe-dist): improve obstacle_cruise_planner safe distance for dence urban ODD scenarios #7987
Changes from all commits
5eec2eb
586ed10
350999a
4cb3960
9d9f497
0438644
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,11 +9,13 @@ | |
enable_slow_down_planning: true | ||
|
||
# longitudinal info | ||
safe_distance_method: "time_based" # currently supported safe distance calculation methods are "rss" and "time-based" | ||
idling_time: 2.0 # idling time to detect front vehicle starting deceleration [s] | ||
min_ego_accel_for_rss: -1.0 # ego's acceleration to calculate RSS distance [m/ss] | ||
min_object_accel_for_rss: -1.0 # front obstacle's acceleration to calculate RSS distance [m/ss] | ||
safe_distance_margin : 6.0 # This is also used as a stop margin [m] | ||
terminal_safe_distance_margin : 3.0 # Stop margin at the goal. This value cannot exceed safe distance margin. [m] | ||
safe_distance_time_margin : 2.0 # This is used for time-based safe distance rule, e.g. 2-seconds rule, 3-seconds rule [s] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you separate the block depending on the logic as follows? rss_based:
idling_time: 2.0
min_ego_accel_for_rs: -1.0
...
time_based:
safe_distance_time_margin: 2.0 |
||
hold_stop_velocity_threshold: 0.01 # The maximum ego velocity to hold stopping [m/s] | ||
hold_stop_distance_threshold: 0.3 # The ego keeps stopping if the distance to stop changes within the threshold [m] | ||
slow_down_min_acc: -1.0 # slow down min deceleration [m/ss] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
// Copyright 2022 TIER IV, Inc. | ||
Check notice on line 1 in planning/autoware_obstacle_cruise_planner/src/pid_based_planner/pid_based_planner.cpp CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)ℹ Getting worse: Overall Code Complexity
|
||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
|
@@ -200,9 +200,17 @@ | |
calcDistanceToCollisionPoint(planner_data, obstacle.collision_points.front().point) + | ||
(obstacle.velocity - planner_data.ego_vel) * time_to_evaluate_rss_; | ||
|
||
// calculate distance between ego and obstacle based on RSS | ||
const double target_dist_to_obstacle = calcRSSDistance( | ||
planner_data.ego_vel, obstacle.velocity, longitudinal_info_.safe_distance_margin); | ||
const double target_dist_to_obstacle = [&]() -> double { | ||
Check warning on line 203 in planning/autoware_obstacle_cruise_planner/src/pid_based_planner/pid_based_planner.cpp Codecov / codecov/patchplanning/autoware_obstacle_cruise_planner/src/pid_based_planner/pid_based_planner.cpp#L203
|
||
if (longitudinal_info_.safe_distance_method == "time_based") { | ||
// calculate distance between ego and obstacle based on time-based rule | ||
return calcTimeBasedSafeDistance( | ||
planner_data.ego_vel, longitudinal_info_.safe_distance_time_margin); | ||
Check warning on line 207 in planning/autoware_obstacle_cruise_planner/src/pid_based_planner/pid_based_planner.cpp Codecov / codecov/patchplanning/autoware_obstacle_cruise_planner/src/pid_based_planner/pid_based_planner.cpp#L206-L207
|
||
} else { | ||
// calculate distance between ego and obstacle based on RSS | ||
return calcRSSDistance( | ||
planner_data.ego_vel, obstacle.velocity, longitudinal_info_.safe_distance_margin); | ||
Check warning on line 211 in planning/autoware_obstacle_cruise_planner/src/pid_based_planner/pid_based_planner.cpp Codecov / codecov/patchplanning/autoware_obstacle_cruise_planner/src/pid_based_planner/pid_based_planner.cpp#L210-L211
|
||
} | ||
}(); | ||
Check warning on line 213 in planning/autoware_obstacle_cruise_planner/src/pid_based_planner/pid_based_planner.cpp CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)❌ Getting worse: Complex Method
Check warning on line 213 in planning/autoware_obstacle_cruise_planner/src/pid_based_planner/pid_based_planner.cpp Codecov / codecov/patchplanning/autoware_obstacle_cruise_planner/src/pid_based_planner/pid_based_planner.cpp#L213
|
||
Comment on lines
+203
to
+213
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you create a member function of calcSafeDistance (you can change the name) which uses calcTimeBasedSafeDistance and calcRSSDistance internally, and make calcTimeBasedSafeDistance and calcRSSDistance functions private so that other people won't use calcTimeBasedSafeDistance and calcRSSDistance directly by mistake? |
||
|
||
// calculate error distance and normalized one | ||
const double error_cruise_dist = dist_to_obstacle - target_dist_to_obstacle; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -444,7 +444,9 @@ | |
const PlannerData & planner_data, const StopObstacle & stop_obstacle) const | ||
{ | ||
if (!enable_approaching_on_curve_ || use_pointcloud_) { | ||
return longitudinal_info_.safe_distance_margin; | ||
double margin_from_obstacle = | ||
calcTimeBasedSafeDistance(planner_data.ego_vel, longitudinal_info_.safe_distance_time_margin); | ||
return margin_from_obstacle; | ||
Check warning on line 449 in planning/autoware_obstacle_cruise_planner/src/planner_interface.cpp CodeScene Delta Analysis / CodeScene Cloud Delta Analysis (main)❌ Getting worse: Complex Method
|
||
Comment on lines
+447
to
+449
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we have to change this part as well? |
||
} | ||
|
||
const double abs_ego_offset = planner_data.is_driving_forward | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change the default one as
rss_based
since this new logic is not well tested, especially in the real environment.