-
Notifications
You must be signed in to change notification settings - Fork 670
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
Conversation
Thank you for contributing to the Autoware project! 🚧 If your pull request is in progress, switch it to draft mode. Please ensure:
|
Signed-off-by: Ahmed Ebrahim <[email protected]>
…to prevent unneeded delayed start of ego following front npc Signed-off-by: Ahmed Ebrahim <[email protected]>
…t between time-based and rss methods Signed-off-by: Ahmed Ebrahim <[email protected]>
Signed-off-by: Ahmed Ebrahim <[email protected]>
1a91870
to
9d9f497
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7987 +/- ##
==========================================
- Coverage 28.94% 28.93% -0.01%
==========================================
Files 1606 1607 +1
Lines 117446 117484 +38
Branches 50463 50471 +8
==========================================
+ Hits 33992 33997 +5
- Misses 74281 74314 +33
Partials 9173 9173
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -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" |
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.
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 comment
The 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
const double target_dist_to_obstacle = [&]() -> double { | ||
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); | ||
} else { | ||
// calculate distance between ego and obstacle based on RSS | ||
return calcRSSDistance( | ||
planner_data.ego_vel, obstacle.velocity, longitudinal_info_.safe_distance_margin); | ||
} | ||
}(); |
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 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?
double margin_from_obstacle = | ||
calcTimeBasedSafeDistance(planner_data.ego_vel, longitudinal_info_.safe_distance_time_margin); | ||
return margin_from_obstacle; |
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.
Do we have to change this part as well?
Like the existing code, the distance for the STOP should be used I guess.
I will close this PR, replacing it with another approach in this PR |
Description
Closes #7922
Related links
Parent Issue:
How was this PR tested?
Using scenario simulation
Before this PR:
2024-07-09.15-09-42.mp4
After this PR:
2024-07-15.23-04-11.mp4
Notes for reviewers
This PR depends on the parameter change in autoware_launch in this PR
Interface changes
ROS Topic Changes
N.A
ROS Parameter Changes
common.safe_distance_method
common.safe_distance_time_margin
Effects on system behavior
Having Autoware
obstacle_cruise_planner
more human like in cruising scenarios, mitigating any mitigate any unnecessary long safe distance ego and npc