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(time-based-safe-dist): improve obstacle_cruise_planner safe distance for dence urban ODD scenarios #7987

Conversation

ahmeddesokyebrahim
Copy link
Contributor

@ahmeddesokyebrahim ahmeddesokyebrahim commented Jul 11, 2024

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

Parameter Name Default Value Update Description
common.safe_distance_method "time_based" safe distance method selection from time_based and RSS
common.safe_distance_time_margin 2.0 time values used in time-based safe distance rule, e.g. 2-seconds rule, 3-seconds rule [s]

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

@ahmeddesokyebrahim ahmeddesokyebrahim self-assigned this Jul 11, 2024
@github-actions github-actions bot added the component:planning Route planning, decision-making, and navigation. (auto-assigned) label Jul 11, 2024
Copy link

github-actions bot commented Jul 11, 2024

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@ahmeddesokyebrahim ahmeddesokyebrahim changed the title feat(time-based-safe-dist): initial implementation feat(time-based-safe-dist): improve obstacle_cruise_planner safe distance for dence urban ODD scenarios Jul 11, 2024
Ahmed Ebrahim and others added 5 commits July 15, 2024 18:51
…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]>
@ahmeddesokyebrahim ahmeddesokyebrahim force-pushed the autoware/universe/7922-feat-time-based-safe-distance branch from 1a91870 to 9d9f497 Compare July 15, 2024 21:38
@github-actions github-actions bot added the type:documentation Creating or refining documentation. (auto-assigned) label Jul 15, 2024
@ahmeddesokyebrahim ahmeddesokyebrahim marked this pull request as ready for review July 15, 2024 22:00
@ahmeddesokyebrahim ahmeddesokyebrahim added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Jul 15, 2024
Copy link

codecov bot commented Jul 15, 2024

Codecov Report

Attention: Patch coverage is 12.50000% with 14 lines in your changes missing coverage. Please review.

Project coverage is 28.93%. Comparing base (0eae67c) to head (0438644).

Files Patch % Lines
...lanner/src/pid_based_planner/pid_based_planner.cpp 0.00% 7 Missing ⚠️
...utoware/obstacle_cruise_planner/common_structs.hpp 33.33% 4 Missing ⚠️
..._obstacle_cruise_planner/src/planner_interface.cpp 0.00% 2 Missing ⚠️
...ware/obstacle_cruise_planner/planner_interface.hpp 0.00% 1 Missing ⚠️
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              
Flag Coverage Δ *Carryforward flag
differential 6.67% <12.50%> (?)
total 28.94% <ø> (+<0.01%) ⬆️ Carriedforward from 0eae67c

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@takayuki5168 takayuki5168 self-assigned this Jul 18, 2024
@@ -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"
Copy link
Contributor

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]
Copy link
Contributor

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

Comment on lines +203 to +213
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);
}
}();
Copy link
Contributor

@takayuki5168 takayuki5168 Jul 18, 2024

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?

Comment on lines +447 to +449
double margin_from_obstacle =
calcTimeBasedSafeDistance(planner_data.ego_vel, longitudinal_info_.safe_distance_time_margin);
return margin_from_obstacle;
Copy link
Contributor

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.

@ahmeddesokyebrahim
Copy link
Contributor Author

I will close this PR, replacing it with another approach in this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:planning Route planning, decision-making, and navigation. (auto-assigned) run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) type:documentation Creating or refining documentation. (auto-assigned)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Dense-Urban-ODD] Improve cruise planner safe distance when cruising a front npc
2 participants