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(behavior_path_planner): add avoid_margin for over distance case #2198

Merged

Conversation

beyzanurkaya
Copy link
Contributor

@beyzanurkaya beyzanurkaya commented Nov 2, 2022

Signed-off-by: beyza bnk@leodrive.ai

Description

Fixes: #2197

Before PR:

Untitled Diagram drawio (4)

After PR:

Untitled Diagram drawio (3)

Pre-review checklist for the PR author

The PR author must check the checkboxes below when creating the PR.

In-review checklist for the PR reviewers

The PR reviewers must check the checkboxes below before approval.

Post-review checklist for the PR author

The PR author must check the checkboxes below before merging.

  • There are no open discussions or they are tracked via tickets.

After all checkboxes are checked, anyone who has write access can merge the PR.

@beyzanurkaya beyzanurkaya changed the title add avoid_margin for over distance case feat(behavior_path_planner):add avoid_margin for over distance case Nov 2, 2022
@beyzanurkaya beyzanurkaya self-assigned this Nov 3, 2022
@mehmetdogru mehmetdogru marked this pull request as ready for review November 3, 2022 08:09
@codecov
Copy link

codecov bot commented Nov 3, 2022

Codecov Report

Base: 10.45% // Head: 10.39% // Decreases project coverage by -0.06% ⚠️

Coverage data is based on head (cbaab34) compared to base (11ff8ef).
Patch coverage: 0.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2198      +/-   ##
==========================================
- Coverage   10.45%   10.39%   -0.07%     
==========================================
  Files        1252     1252              
  Lines       91231    91787     +556     
  Branches    20922    21379     +457     
==========================================
  Hits         9537     9537              
- Misses      71557    72061     +504     
- Partials    10137    10189      +52     
Flag Coverage Δ *Carryforward flag
differential 3.22% <0.00%> (?)
total 10.42% <0.00%> (ø) Carriedforward from 11ff8ef

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

Impacted Files Coverage Δ
...er/src/scene_module/avoidance/avoidance_module.cpp 0.00% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@beyzanurkaya beyzanurkaya force-pushed the bpp-over-shift-point-case branch from d05dfb8 to 5760d0d Compare November 3, 2022 08:58
@beyzanurkaya beyzanurkaya changed the title feat(behavior_path_planner):add avoid_margin for over distance case feat(behavior_path_planner): add avoid_margin for over distance case Nov 3, 2022
@beyzanurkaya
Copy link
Contributor Author

waiting for review :)

@mitsudome-r
Copy link
Member

ping @takayuki5168

@satoshi-ota
Copy link
Contributor

satoshi-ota commented Nov 8, 2022

@beyzanurkaya cc @mitsudome-r @takayuki5168 Thanks for your contribute!! I'll review in this week.

@satoshi-ota
Copy link
Contributor

satoshi-ota commented Nov 11, 2022

@beyzanurkaya Thanks for your PR 😄

I assume that this PR modification will let the avoidance module generate an unpassable avoidance path due to insufficient lateral margin. Could you please tell me about the benefits of this PR? You want avoidance module to generate an avoidance path even if it is insufficient for the lateral margin defined by the parameter, right?

@xmfcx
Copy link
Contributor

xmfcx commented Nov 15, 2022

@mehmetdogru will share more details on this issue/PR.

beyzanurkaya and others added 3 commits November 21, 2022 14:57
Signed-off-by: beyza <bnk@leodrive.ai>
Signed-off-by: Mehmet Dogru <42mehmetdogru42@gmail.com>
@mehmetdogru mehmetdogru force-pushed the bpp-over-shift-point-case branch from 5760d0d to cbaab34 Compare November 21, 2022 18:32
@mehmetdogru mehmetdogru requested a review from a team as a code owner November 21, 2022 18:32
@mehmetdogru
Copy link
Contributor

mehmetdogru commented Nov 21, 2022

@satoshi-ota

Sorry for not being clear enough and of course in the suggested way some avoidance path would have insufficient clearance for the ego. So let me explain the issue we are having with the current implementation first then I will shortly present my new proposal.

So in avoidance module there are two margin params (lateral_collision_margin & lateral_collision_safety_buffer) added to vehicle_width/2 to calculate avoid_margin. They are of course the same for all the lanes and roads regardless of how wide or narrow they are. In cases where there are both wide and narrow roads such as in campuses things are getting tricky.

We know that:

avoid_margin = lat_collision_safety_buffer + lat_collision_margin + 0.5 * vehicle_width;

In case 1 I tune my parameters for narrow roads:

So I keep lat_collision_margin, lat_collision_safety_buffer and road_shoulder_safety_margin as small as possible. However for wide roads I want ego to shift more since there are plenty of space on the lane but I tuned the params for narrow road so it is not possible:

avoid_margin_1


In case 2 I tune my parameters for wide roads:

I set params above as I think is proper for the safety and comfort then for narrow roads ego wouldn't do the avoidance:

avoid_margin_2


My proposal is that instead of keeping avoid_margin stable (at_collision_safety_buffer + lat_collision_margin + 0.5 * vehicle_width), we can let it vary between max_allowable_lateral_distance and min_safety_lateral_distance.

max_allowable_lateral_distance already exists:

max_allowable_lateral_distance = o.to_road_shoulder_distance - road_shoulder_safety_margin - 0.5 * vehicle_width

And lets define min_safety_lateral_distance as:

min_safety_lateral_distance = lat_collision_safety_buffer + 0.5 * vehicle_width

So I think in the current implementation lat_collision_margin and lat_collision_safety_buffer does the same job since just summation of these two is used. With the approach I am proposing we can set min & max margin using lat_collision_margin and lat_collision_safety_buffer then let avoid_margin vary between them. In this case for the both scenarios above, ego would do the avoidance as user wanted.

@satoshi-ota to please review the proposed changes in the PR.

@github-actions github-actions bot added the component:planning Route planning, decision-making, and navigation. (auto-assigned) label Nov 21, 2022
@satoshi-ota
Copy link
Contributor

satoshi-ota commented Nov 22, 2022

@mehmetdogru @beyzanurkaya Thank you. They are clear to me.

So I think in the current implementation lat_collision_margin and lat_collision_safety_buffer does the same job since just summation of these two is used. With the approach I am proposing we can set min & max margin using lat_collision_margin and lat_collision_safety_buffer then let avoid_margin vary between them. In this case for the both scenarios above, ego would do the avoidance as user wanted.

I was concerned that even if it was a shift point that could not be passed, an avoidance path would be generated and the vehicle would follow it, but now, I understand that what you want to do by your explanation and this commit 👍

I think your method looks good to me.

@mehmetdogru
Copy link
Contributor

@satoshi-ota

Shall we go ahead and merge these changes? Are you ok with them?

@mehmetdogru mehmetdogru added this to the Bus ODD Nov-Dec Milestone milestone Nov 22, 2022
Copy link
Contributor

@satoshi-ota satoshi-ota left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mehmetdogru mehmetdogru merged commit eb9fcec into autowarefoundation:main Nov 22, 2022
@satoshi-ota
Copy link
Contributor

@beyzanurkaya @mehmetdogru Could you update avoidance documentation in another PR?

HansRobo pushed a commit to HansRobo/autoware.universe that referenced this pull request Dec 16, 2022
…utowarefoundation#2198)

* add avoid margin for over distance case

Signed-off-by: beyza <bnk@leodrive.ai>

* ci(pre-commit): autofix

* fix: let avoid_margin vary between min and max value

Signed-off-by: Mehmet Dogru <42mehmetdogru42@gmail.com>

Signed-off-by: beyza <bnk@leodrive.ai>
Signed-off-by: Mehmet Dogru <42mehmetdogru42@gmail.com>
Co-authored-by: beyza <bnk@leodrive.ai>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Mehmet Dogru <42mehmetdogru42@gmail.com>
Signed-off-by: Kotaro Yoshimoto <pythagora.yoshimoto@gmail.com>
kminoda pushed a commit to kminoda/autoware.universe that referenced this pull request Jan 6, 2023
…utowarefoundation#2198)

* add avoid margin for over distance case

Signed-off-by: beyza <bnk@leodrive.ai>

* ci(pre-commit): autofix

* fix: let avoid_margin vary between min and max value

Signed-off-by: Mehmet Dogru <42mehmetdogru42@gmail.com>

Signed-off-by: beyza <bnk@leodrive.ai>
Signed-off-by: Mehmet Dogru <42mehmetdogru42@gmail.com>
Co-authored-by: beyza <bnk@leodrive.ai>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Mehmet Dogru <42mehmetdogru42@gmail.com>
Signed-off-by: kminoda <koji.minoda@tier4.jp>
YoshiRi pushed a commit to YoshiRi/autoware.universe that referenced this pull request Jan 11, 2023
…utowarefoundation#2198)

* add avoid margin for over distance case

Signed-off-by: beyza <bnk@leodrive.ai>

* ci(pre-commit): autofix

* fix: let avoid_margin vary between min and max value

Signed-off-by: Mehmet Dogru <42mehmetdogru42@gmail.com>

Signed-off-by: beyza <bnk@leodrive.ai>
Signed-off-by: Mehmet Dogru <42mehmetdogru42@gmail.com>
Co-authored-by: beyza <bnk@leodrive.ai>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Mehmet Dogru <42mehmetdogru42@gmail.com>
Signed-off-by: yoshiri <yoshiyoshidetteiu@gmail.com>
@beyzanurkaya beyzanurkaya deleted the bpp-over-shift-point-case branch June 9, 2023 08:20
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)
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

behavior_path_planner does not create a shift point some cases
5 participants