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(start_planner): prevent hindering rear vehicles #6545

Conversation

danielsanchezaran
Copy link
Contributor

@danielsanchezaran danielsanchezaran commented Mar 5, 2024

Description

Current Autoware:
Currently, obstacle collision check with vehicles coming from the rear is performed when the ego vehicle is trying to merge to a lane from the shoulder lane. As follows:

image

The collision check is done until the ego vehicle eventually overlaps with the centerline. However, it is possible that the check is performed when the ego vehicle already impedes the pass of vehicles as shown on the next image:

image

In the case above, the ego vehicle has not quite overlapped the centerline yet (closest point in purple) but the gap between the ego and the lane boundary, W2, is smaller than the width W1 of the NPC vehicle (black). In this cases, with collision check active, the ego vehicle might stop moving, even though the rear vehicle cannot really pass. The final outcome is that the ego vehicle ends up impeding the previous vehicle from passing and also remains stopped.

This PR:
With this PR, the ego will not check overlaps with the center line; instead, it will check whether the remaining gap between the ego and the lane is big enough for the rear obstacle to pass. If it is big enough, the ego stops/yields to the coming vehicle, but, if it is smaller, it means the rear vehicle cannot stop and the ego should proceed. There is also an added parameter "extra_width_margin_for_rear_obstacle" which can be used to artificially enlarge or reduce the rear vehicle's perceived width.

Example:

  1. The gap is big enough for the rear vehicle to pass, so the ego stops (start planner's red virtual wall)

image

  1. The gap is small, the rear vehicle cannot pass and the ego has "claimed" the lane: The ego vehicle proceeds, no stop point is added (note the ego is not overlapping the centerline yet):

image

  1. Same ego pose as 2) but the rear bicycle is small, so it can still fit in the gap left by ego: A stop point is inserted and we let the bicycle pass.

image

Related links

Related ticket: TIER IV INTERNAL LINK

Tests performed

PSIM

Degradation tests -> NO degradation TIER IV INTERNAL LINK

Notes for reviewers

A function to get the backward lanes was moved from lane change module to common so it can be used by the start planner too.

Interface changes

Effects on system behavior

The ego will not impede upcoming traffic by not committing to a lane entrance it should do.

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.

  • The PR follows the pull request guidelines.
  • The PR has been properly tested.
  • The PR has been reviewed by the code owners.

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.
  • The PR is ready for merge.

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

@github-actions github-actions bot added the component:planning Route planning, decision-making, and navigation. (auto-assigned) label Mar 5, 2024
@github-actions github-actions bot added the type:documentation Creating or refining documentation. (auto-assigned) label Mar 5, 2024
@danielsanchezaran danielsanchezaran marked this pull request as ready for review March 5, 2024 07:43
@danielsanchezaran danielsanchezaran force-pushed the feat/prevent-hindering-rear-vehicles branch from c91137f to ff6f063 Compare March 6, 2024 00:21
Copy link
Contributor

@zulfaqar-azmi-t4 zulfaqar-azmi-t4 left a comment

Choose a reason for hiding this comment

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

LGTM

return -calc_right_lateral_offset(boundary_line, search_pose);
};

// Get the ego's overhang point closest to the centerline path and the gap between said point an
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Get the ego's overhang point closest to the centerline path and the gap between said point an
// Get the ego's overhang point closest to the centerline path and the gap between said point and

@kyoichi-sugahara
Copy link
Contributor

@danielsanchezaran
If my understanding is correct, the assumption is merging from left lane, correct?
If ego merge from right side, the gap is wrongly calculated?
image

@kyoichi-sugahara
Copy link
Contributor

@danielsanchezaran
It feels like it would be better to determine from which side the merging is happening. Therefore, using getOriginalStartPose() and the target lanes to judge whether the starting point is on the right or left side of the target lane might be a good idea.
What do you think?

@kyoichi-sugahara
Copy link
Contributor

Can not request a change...
How about changing following description from

    if (Can stop within constraints \n && \n no crossing centerline?) then (yes)

to

    if (Can stop within constraints \n && \n Has sufficient space for rear vehicle to drive?) then (yes)

@danielsanchezaran
Copy link
Contributor Author

@danielsanchezaran If my understanding is correct, the assumption is merging from left lane, correct? If ego merge from right side, the gap is wrongly calculated? image

The current calculates both distances to the left AND right edges of the road and uses the largest one, so, in the case you describe, the gap would be the distance between the left bound of the lane and the ego's overhang point. So it does not matter from which side the merging is happening.

@danielsanchezaran danielsanchezaran force-pushed the feat/prevent-hindering-rear-vehicles branch from 78f329c to ea4915f Compare March 7, 2024 02:09
@danielsanchezaran
Copy link
Contributor Author

The code has been updated so the closest ego overhang point to the lane border is used to calculate the gap. The border to calculate the distance is chosen depending on which side the ego is merging the lane from. @kyoichi-sugahara

Copy link
Contributor

@kyoichi-sugahara kyoichi-sugahara left a comment

Choose a reason for hiding this comment

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

Thank you so much for your quick response!
LGTM!

Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Daniel Sanchez <[email protected]>
@danielsanchezaran danielsanchezaran force-pushed the feat/prevent-hindering-rear-vehicles branch from 1e01b65 to ec5179b Compare March 7, 2024 05:34
@danielsanchezaran danielsanchezaran added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Mar 7, 2024
Copy link

codecov bot commented Mar 7, 2024

Codecov Report

Attention: Patch coverage is 0% with 98 lines in your changes are missing coverage. Please review.

Project coverage is 14.79%. Comparing base (7081a61) to head (ec5179b).

Files Patch % Lines
..._start_planner_module/src/start_planner_module.cpp 0.00% 78 Missing ⚠️
...g/behavior_path_planner_common/src/utils/utils.cpp 0.00% 14 Missing ⚠️
...behavior_path_start_planner_module/src/manager.cpp 0.00% 5 Missing ⚠️
...rc/utils/path_safety_checker/objects_filtering.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6545      +/-   ##
==========================================
- Coverage   14.80%   14.79%   -0.01%     
==========================================
  Files        1917     1917              
  Lines      132086   132146      +60     
  Branches    39262    39262              
==========================================
  Hits        19553    19553              
- Misses      90715    90775      +60     
  Partials    21818    21818              
Flag Coverage Δ *Carryforward flag
differential 10.76% <0.00%> (?)
total 14.80% <ø> (+<0.01%) ⬆️ Carriedforward from 7081a61

*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.

@danielsanchezaran danielsanchezaran merged commit 07a84d4 into autowarefoundation:main Mar 7, 2024
30 of 33 checks passed
@danielsanchezaran danielsanchezaran deleted the feat/prevent-hindering-rear-vehicles branch March 7, 2024 08:09
HansRobo pushed a commit that referenced this pull request Mar 12, 2024
* wip add function to check if other vehicles can pass

Signed-off-by: Daniel Sanchez <[email protected]>

* further refactoring

Signed-off-by: Daniel Sanchez <[email protected]>

* change breaks for return

Signed-off-by: Daniel Sanchez <[email protected]>

* added way to check closest overhang point to target centerline

Signed-off-by: Daniel Sanchez <[email protected]>

* wip get distance to left and right bounds

Signed-off-by: Daniel Sanchez <[email protected]>

* add check for param dereferencing

Signed-off-by: Daniel Sanchez <[email protected]>

* check gap and rear vehicle width

Signed-off-by: Daniel Sanchez <[email protected]>

* bugfix boolean condition was inverted

Signed-off-by: Daniel Sanchez <[email protected]>

* refactor

Signed-off-by: Daniel Sanchez <[email protected]>

* rename param

Signed-off-by: Daniel Sanchez <[email protected]>

* remove prints

Signed-off-by: Daniel Sanchez <[email protected]>

* use a better function to get the previous lanelets

Signed-off-by: Daniel Sanchez <[email protected]>

* update docs

Signed-off-by: Daniel Sanchez <[email protected]>

* update description

Signed-off-by: Daniel Sanchez <[email protected]>

* typo

Signed-off-by: Daniel Sanchez <[email protected]>

* update readme

Signed-off-by: Daniel Sanchez <[email protected]>

* Use the merging side to choose what lane bound to use

Signed-off-by: Daniel Sanchez <[email protected]>

* delete unused function

Signed-off-by: Daniel Sanchez <[email protected]>

* add debug message

Signed-off-by: Daniel Sanchez <[email protected]>

---------

Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: Kotaro Yoshimoto <[email protected]>
kaigohirao pushed a commit to kaigohirao/autoware.universe that referenced this pull request Mar 22, 2024
…ion#6545)

* wip add function to check if other vehicles can pass

Signed-off-by: Daniel Sanchez <[email protected]>

* further refactoring

Signed-off-by: Daniel Sanchez <[email protected]>

* change breaks for return

Signed-off-by: Daniel Sanchez <[email protected]>

* added way to check closest overhang point to target centerline

Signed-off-by: Daniel Sanchez <[email protected]>

* wip get distance to left and right bounds

Signed-off-by: Daniel Sanchez <[email protected]>

* add check for param dereferencing

Signed-off-by: Daniel Sanchez <[email protected]>

* check gap and rear vehicle width

Signed-off-by: Daniel Sanchez <[email protected]>

* bugfix boolean condition was inverted

Signed-off-by: Daniel Sanchez <[email protected]>

* refactor

Signed-off-by: Daniel Sanchez <[email protected]>

* rename param

Signed-off-by: Daniel Sanchez <[email protected]>

* remove prints

Signed-off-by: Daniel Sanchez <[email protected]>

* use a better function to get the previous lanelets

Signed-off-by: Daniel Sanchez <[email protected]>

* update docs

Signed-off-by: Daniel Sanchez <[email protected]>

* update description

Signed-off-by: Daniel Sanchez <[email protected]>

* typo

Signed-off-by: Daniel Sanchez <[email protected]>

* update readme

Signed-off-by: Daniel Sanchez <[email protected]>

* Use the merging side to choose what lane bound to use

Signed-off-by: Daniel Sanchez <[email protected]>

* delete unused function

Signed-off-by: Daniel Sanchez <[email protected]>

* add debug message

Signed-off-by: Daniel Sanchez <[email protected]>

---------

Signed-off-by: Daniel Sanchez <[email protected]>
Signed-off-by: kaigohirao <[email protected]>
karishma1911 pushed a commit to Interplai/autoware.universe that referenced this pull request Jun 3, 2024
…ion#6545)

* wip add function to check if other vehicles can pass

Signed-off-by: Daniel Sanchez <[email protected]>

* further refactoring

Signed-off-by: Daniel Sanchez <[email protected]>

* change breaks for return

Signed-off-by: Daniel Sanchez <[email protected]>

* added way to check closest overhang point to target centerline

Signed-off-by: Daniel Sanchez <[email protected]>

* wip get distance to left and right bounds

Signed-off-by: Daniel Sanchez <[email protected]>

* add check for param dereferencing

Signed-off-by: Daniel Sanchez <[email protected]>

* check gap and rear vehicle width

Signed-off-by: Daniel Sanchez <[email protected]>

* bugfix boolean condition was inverted

Signed-off-by: Daniel Sanchez <[email protected]>

* refactor

Signed-off-by: Daniel Sanchez <[email protected]>

* rename param

Signed-off-by: Daniel Sanchez <[email protected]>

* remove prints

Signed-off-by: Daniel Sanchez <[email protected]>

* use a better function to get the previous lanelets

Signed-off-by: Daniel Sanchez <[email protected]>

* update docs

Signed-off-by: Daniel Sanchez <[email protected]>

* update description

Signed-off-by: Daniel Sanchez <[email protected]>

* typo

Signed-off-by: Daniel Sanchez <[email protected]>

* update readme

Signed-off-by: Daniel Sanchez <[email protected]>

* Use the merging side to choose what lane bound to use

Signed-off-by: Daniel Sanchez <[email protected]>

* delete unused function

Signed-off-by: Daniel Sanchez <[email protected]>

* add debug message

Signed-off-by: Daniel Sanchez <[email protected]>

---------

Signed-off-by: Daniel Sanchez <[email protected]>
satoshi-ota pushed a commit to tier4/autoware.universe that referenced this pull request Jun 6, 2024
…ion#6545)

* wip add function to check if other vehicles can pass

Signed-off-by: Daniel Sanchez <[email protected]>

* further refactoring

Signed-off-by: Daniel Sanchez <[email protected]>

* change breaks for return

Signed-off-by: Daniel Sanchez <[email protected]>

* added way to check closest overhang point to target centerline

Signed-off-by: Daniel Sanchez <[email protected]>

* wip get distance to left and right bounds

Signed-off-by: Daniel Sanchez <[email protected]>

* add check for param dereferencing

Signed-off-by: Daniel Sanchez <[email protected]>

* check gap and rear vehicle width

Signed-off-by: Daniel Sanchez <[email protected]>

* bugfix boolean condition was inverted

Signed-off-by: Daniel Sanchez <[email protected]>

* refactor

Signed-off-by: Daniel Sanchez <[email protected]>

* rename param

Signed-off-by: Daniel Sanchez <[email protected]>

* remove prints

Signed-off-by: Daniel Sanchez <[email protected]>

* use a better function to get the previous lanelets

Signed-off-by: Daniel Sanchez <[email protected]>

* update docs

Signed-off-by: Daniel Sanchez <[email protected]>

* update description

Signed-off-by: Daniel Sanchez <[email protected]>

* typo

Signed-off-by: Daniel Sanchez <[email protected]>

* update readme

Signed-off-by: Daniel Sanchez <[email protected]>

* Use the merging side to choose what lane bound to use

Signed-off-by: Daniel Sanchez <[email protected]>

* delete unused function

Signed-off-by: Daniel Sanchez <[email protected]>

* add debug message

Signed-off-by: Daniel Sanchez <[email protected]>

---------

Signed-off-by: Daniel Sanchez <[email protected]>
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.

3 participants