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): update path when object is gone #2314

Conversation

ismetatabay
Copy link
Member

@ismetatabay ismetatabay commented Nov 17, 2022

Signed-off-by: ismet atabay [email protected]

Description

At avoidance module in behavior_path_planner, if the detected objects occur in path, avoidance module shift path points to around the vehicle. Moreover, if the detected objects are gone the shifted path is not updated. The reason of this, avoidance module' current state stays in the "RUNNING" state until the vehicle reach its goal. I added a feature to change this state, and this feature allows the path to be updated by completing the task of the avoidance module if the detected objects are gone.

To control this, I added a parameter with the name enable_update_path_when_object_is_gone and set the default value to false. enable_update_path_when_object_is_gone must be true for this feature to be used.

Related links

closes #2272

Tests performed

Before PR (enable_update_path_when_object_is_gone is set to false):

before_pr.mp4

After PR (enable_update_path_when_object_is_gone is set to true):

Case 1: The vehicle stops.

vehicle_stops.mp4

Case 2: The vehicle moves, avoidance maneuver doesn't starts.

vehicle_runs_wo_avoidance.mp4

Case 3: The vehicle moves, avoidance maneuver starts.

vehicle_runs_w_avoidance.mp4

Notes for reviewers

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 component:launch Launch files, scripts and initialization tools. (auto-assigned) component:planning Route planning, decision-making, and navigation. (auto-assigned) labels Nov 17, 2022
@ismetatabay ismetatabay changed the title feat(behavior_path_planner): update state with obstacles feat(behavior_path_planner): update path when object is gone Nov 17, 2022
@ismetatabay ismetatabay force-pushed the feature/update_state_with_objects branch 2 times, most recently from 83d7b13 to 4cb059d Compare November 17, 2022 14:44
@ismetatabay ismetatabay self-assigned this Nov 17, 2022
@codecov
Copy link

codecov bot commented Nov 17, 2022

Codecov Report

Base: 10.64% // Head: 10.44% // Decreases project coverage by -0.19% ⚠️

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

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2314      +/-   ##
==========================================
- Coverage   10.64%   10.44%   -0.20%     
==========================================
  Files        1239     1240       +1     
  Lines       82824    85130    +2306     
  Branches    20399    21921    +1522     
==========================================
+ Hits         8815     8894      +79     
- Misses      64319    66265    +1946     
- Partials     9690     9971     +281     
Flag Coverage Δ *Carryforward flag
differential 3.17% <0.00%> (?)
total 10.64% <0.00%> (ø) Carriedforward from 4c1ccc8

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

Impacted Files Coverage Δ
...lanner/scene_module/avoidance/avoidance_module.hpp 0.00% <ø> (ø)
...r/scene_module/avoidance/avoidance_module_data.hpp 0.00% <ø> (ø)
...or_path_planner/src/behavior_path_planner_node.cpp 0.15% <0.00%> (+0.15%) ⬆️
...er/src/scene_module/avoidance/avoidance_module.cpp 0.00% <0.00%> (ø)
planning/behavior_path_planner/test/input.cpp 60.00% <0.00%> (-7.86%) ⬇️
...ng/behavior_path_planner/test/test_turn_signal.cpp 40.41% <0.00%> (-6.86%) ⬇️
...ner/src/scene_module/avoidance/avoidance_utils.cpp 1.93% <0.00%> (-0.10%) ⬇️
planning/static_centerline_optimizer/src/main.cpp 0.00% <0.00%> (ø)
planning/static_centerline_optimizer/src/utils.cpp 0.00% <0.00%> (ø)
...nning/behavior_path_planner/src/path_utilities.cpp 0.00% <0.00%> (ø)
... and 35 more

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.

@ismetatabay ismetatabay force-pushed the feature/update_state_with_objects branch from fc57475 to 7dcd6e5 Compare November 18, 2022 09:52
@ismetatabay ismetatabay marked this pull request as ready for review November 18, 2022 10:50
@github-actions github-actions bot added the type:documentation Creating or refining documentation. (auto-assigned) label Nov 18, 2022
@ismetatabay ismetatabay force-pushed the feature/update_state_with_objects branch from 2feda2c to 0cdf2fd Compare November 18, 2022 11:17
@satoshi-ota
Copy link
Contributor

@ismetatabay Thanks for your contribution 😄

Could you show the ego behavior in case where the ego is in avoidance maneuver? I think it dangerous that the path suddenly reverts back to its original one when there is huge lateral deviation between the ego and reverted path.

@ismetatabay
Copy link
Member Author

@satoshi-ota Hi,
Thank you for comment, the behavior of the car is as in the video below. What do you suggest in this situation? Maybe we can revert the path if the vehicle is stopped, but we do not change the path while the vehicle is in motion.

2022-11-20.13-55-39.mp4

@satoshi-ota
Copy link
Contributor

satoshi-ota commented Nov 20, 2022

@ismetatabay Thanks for your explanation 👍

The following scene is exactly the scenario I was concerned about. In this case, I think it would be better to replan the return path from Ego's position back to the original reference path, because it is an abnormal situation for a system where the vehicle deviates significantly from its path, and I think we have to avoid such a situation as much as possible. What would you think?

As another idea, I think it would be good to make the assumption that the canceling of the avoidance maneuver is limited to only when the ego has not initiated the avoidance and there is not much deviation between the ego and reverted path.

cc @TakaHoribe @zulfaqar-azmi-t4

image

@ismetatabay
Copy link
Member Author

@satoshi-ota Thanks also for suggesting 2 solutions,
With these solutions we can get a reasonable behavior. In terms of safety, your second suggestion seemed safer to me. An algorithm like this looks good to me:

If the vehicle has not started the avoidance maneuver, the avoidance path can be reverted, if the avoidance maneuver has been started, remain the avoidance path to follow it. The avoidance path follows a very smooth path to return to the old path. So it made sense to me to follow this avoid path to avoid sudden lateral change.

If that's okay I can update the algorithm.

@ismetatabay ismetatabay force-pushed the feature/update_state_with_objects branch 3 times, most recently from ec4439f to 390beac Compare November 24, 2022 12:42
ismetatabay and others added 6 commits November 24, 2022 18:25
Signed-off-by: ismet atabay <[email protected]>

feat(behavior_path_planner): update path when obstacle is gone

Signed-off-by: ismet atabay <[email protected]>
Signed-off-by: ismetatabay <[email protected]>
Signed-off-by: ismetatabay <[email protected]>
Signed-off-by: ismetatabay <[email protected]>

update check mechanism

Signed-off-by: ismetatabay <[email protected]>

update check mechanism

Signed-off-by: ismetatabay <[email protected]>
Signed-off-by: ismetatabay <[email protected]>
Signed-off-by: ismetatabay <[email protected]>
Signed-off-by: ismet atabay <[email protected]>

ci(pre-commit): autofix

avoidance maneuver checker is added.

Signed-off-by: ismet atabay <[email protected]>
Signed-off-by: ismetatabay <[email protected]>
@ismetatabay ismetatabay force-pushed the feature/update_state_with_objects branch from 387285f to 83256a8 Compare November 24, 2022 15:25
Signed-off-by: ismetatabay <[email protected]>

fix check algorithm

Signed-off-by: ismetatabay <[email protected]>
@ismetatabay ismetatabay force-pushed the feature/update_state_with_objects branch from 9168592 to 4c1ccc8 Compare November 24, 2022 15:45
@ismetatabay
Copy link
Member Author

@satoshi-ota hi, I updated the algorithm and the videos in the description according to the cases we talked about earlier 👍 .

@satoshi-ota
Copy link
Contributor

@ismetatabay Thanks a lot 👍 I'll review this, so please wait a few days.

@ismetatabay ismetatabay marked this pull request as ready for review November 25, 2022 08:28
@satoshi-ota
Copy link
Contributor

satoshi-ota commented Nov 28, 2022

@ismetatabay I'm working on testing your login in my local environment, and it looks good to me 👍 Finally, could you please add description of avoid canceling (not only related param but also the assumption, flow, etc...) to the documentation?

simplescreenrecorder-2022-11-28_17.46.19.mp4

@ismetatabay
Copy link
Member Author

ismetatabay commented Nov 29, 2022

@satoshi-ota hi, I added "Avoidance Cancelling" section to the documentation. At this section, I explain Avoidance Module behavior at each different cases.

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.

@ismetatabay Perfect 👍
Thanks for your contribution!

If `enable_update_path_when_object_is_gone` parameter is true, Avoidance Module takes different actions according to the situations as follows:

- If vehicle stops: If there is any object in the path of the vehicle, the avoidance path is generated. If this object goes away while the vehicle is stopping, the avoidance path will cancelled.
- If vehcile is in motion, but avoidance maneuver doesn't started: If there is any object in the path of the vehicle, the avoidance path is generated. If this object goes away while the vehicle is not started avoidance maneuver, the avoidance path will cancelled.
Copy link
Contributor

Choose a reason for hiding this comment

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

@ismetatabay Sorry, could you fix this typo? 😅

vehcile -> vehicle

Copy link
Member Author

Choose a reason for hiding this comment

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

@satoshi-ota Sorry i missed it, i updated it now. 👍

@satoshi-ota satoshi-ota self-requested a review November 30, 2022 08:22

- If vehicle stops: If there is any object in the path of the vehicle, the avoidance path is generated. If this object goes away while the vehicle is stopping, the avoidance path will cancelled.
- If vehcile is in motion, but avoidance maneuver doesn't started: If there is any object in the path of the vehicle, the avoidance path is generated. If this object goes away while the vehicle is not started avoidance maneuver, the avoidance path will cancelled.
- If vehcile is in motion, avoidance maneuver started: If there is any object in the path of the vehicle, the avoidance path is generated,but if this object goes away while the vehicle is started avoidance maneuver, the avoidance path will not cancelled.
Copy link
Contributor

Choose a reason for hiding this comment

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

vehcile -> vehicle

Signed-off-by: ismetatabay <[email protected]>
@satoshi-ota
Copy link
Contributor

@ismetatabay Thanks 😄 You can merge this PR 🎉

@satoshi-ota satoshi-ota merged commit 40aa7e3 into autowarefoundation:main Dec 1, 2022
HansRobo pushed a commit to HansRobo/autoware.universe that referenced this pull request Dec 16, 2022
…efoundation#2314)

* feat(behavior_path_planner): update state with obstacles.

Signed-off-by: ismet atabay <[email protected]>

feat(behavior_path_planner): update path when obstacle is gone

Signed-off-by: ismet atabay <[email protected]>
Signed-off-by: ismetatabay <[email protected]>

* ci(pre-commit): autofix

Signed-off-by: ismetatabay <[email protected]>

* update check mechanism

Signed-off-by: ismetatabay <[email protected]>

update check mechanism

Signed-off-by: ismetatabay <[email protected]>

update check mechanism

Signed-off-by: ismetatabay <[email protected]>

* readme.md is updated

Signed-off-by: ismetatabay <[email protected]>

* ci(pre-commit): autofix

Signed-off-by: ismetatabay <[email protected]>

* avoidance maneuver checker is added.

Signed-off-by: ismet atabay <[email protected]>

ci(pre-commit): autofix

avoidance maneuver checker is added.

Signed-off-by: ismet atabay <[email protected]>
Signed-off-by: ismetatabay <[email protected]>

* fix check algorithm

Signed-off-by: ismetatabay <[email protected]>

fix check algorithm

Signed-off-by: ismetatabay <[email protected]>

* documentation is updated.

Signed-off-by: ismetatabay <[email protected]>

* ci(pre-commit): autofix

* fix typos

Signed-off-by: ismetatabay <[email protected]>

Signed-off-by: ismet atabay <[email protected]>
Signed-off-by: ismetatabay <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Signed-off-by: Kotaro Yoshimoto <[email protected]>
kminoda pushed a commit to kminoda/autoware.universe that referenced this pull request Jan 6, 2023
…efoundation#2314)

* feat(behavior_path_planner): update state with obstacles.

Signed-off-by: ismet atabay <[email protected]>

feat(behavior_path_planner): update path when obstacle is gone

Signed-off-by: ismet atabay <[email protected]>
Signed-off-by: ismetatabay <[email protected]>

* ci(pre-commit): autofix

Signed-off-by: ismetatabay <[email protected]>

* update check mechanism

Signed-off-by: ismetatabay <[email protected]>

update check mechanism

Signed-off-by: ismetatabay <[email protected]>

update check mechanism

Signed-off-by: ismetatabay <[email protected]>

* readme.md is updated

Signed-off-by: ismetatabay <[email protected]>

* ci(pre-commit): autofix

Signed-off-by: ismetatabay <[email protected]>

* avoidance maneuver checker is added.

Signed-off-by: ismet atabay <[email protected]>

ci(pre-commit): autofix

avoidance maneuver checker is added.

Signed-off-by: ismet atabay <[email protected]>
Signed-off-by: ismetatabay <[email protected]>

* fix check algorithm

Signed-off-by: ismetatabay <[email protected]>

fix check algorithm

Signed-off-by: ismetatabay <[email protected]>

* documentation is updated.

Signed-off-by: ismetatabay <[email protected]>

* ci(pre-commit): autofix

* fix typos

Signed-off-by: ismetatabay <[email protected]>

Signed-off-by: ismet atabay <[email protected]>
Signed-off-by: ismetatabay <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Signed-off-by: kminoda <[email protected]>
@ismetatabay ismetatabay deleted the feature/update_state_with_objects branch May 20, 2024 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:launch Launch files, scripts and initialization tools. (auto-assigned) component:planning Route planning, decision-making, and navigation. (auto-assigned) type:documentation Creating or refining documentation. (auto-assigned)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

obstacle_stop_planner does not revert its avoidance path after the avoided obstacle is gone.
2 participants