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(autoware_behavior_path_planner): prevent infinite loop in approving scene module process #7881

Conversation

kyoichi-sugahara
Copy link
Contributor

@kyoichi-sugahara kyoichi-sugahara commented Jul 8, 2024

Description

This PR should be merged first.

Current potential issue:

When scene modules A > B > C are in the approved state and A fails, all modules (A, B, C) are removed from approved_modules. Additionally, candidate_modules becomes empty, causing all modules A-Z to be re-evaluated through getRequestModules -> runRequestModules. This leads to A > B > C being approved again, and if A fails once more, an infinite loop may occur.

Proposed solution:

Prevent modules that have been removed from approved_modules due to success or failure from being added again by getRequestModules.

  1. In runApprovedModules, add modules that have transitioned to success or failure state to deleted_modules.
  2. In getRequestModules, skip the execution request judgment for modules that have been added to deleted_modules.

Additional change:

By implementing a process to delete modules that have either succeeded or failed in the loop, the maximum number of loops can now be theoretically determined based on the number of scene modules. As a result, I've changed the method to calculate the theoretical maximum instead of using a parameter definition.

How was this PR tested?

Notes for reviewers

None.

Effects on system behavior

None.

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

github-actions bot commented Jul 8, 2024

Thank you for contributing to the Autoware project!

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

Please ensure:

@kyoichi-sugahara kyoichi-sugahara marked this pull request as ready for review July 8, 2024 01:39
@kyoichi-sugahara kyoichi-sugahara force-pushed the feat/prevent_infinite_loop branch from 4db069f to bcb2368 Compare July 8, 2024 01:42
@kyoichi-sugahara kyoichi-sugahara force-pushed the feat/prevent_infinite_loop branch from bcb2368 to ebfba74 Compare July 8, 2024 11:18
@github-actions github-actions bot added type:documentation Creating or refining documentation. (auto-assigned) component:perception Advanced sensor data processing and environment understanding. (auto-assigned) component:launch Launch files, scripts and initialization tools. (auto-assigned) component:common Common packages from the autoware-common repository. (auto-assigned) labels Jul 9, 2024
kyoichi-sugahara and others added 3 commits July 9, 2024 13:56
Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>
Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>
@kyoichi-sugahara kyoichi-sugahara force-pushed the feat/prevent_infinite_loop branch from 0521215 to d2c8977 Compare July 9, 2024 04:56
@github-actions github-actions bot removed type:documentation Creating or refining documentation. (auto-assigned) component:perception Advanced sensor data processing and environment understanding. (auto-assigned) component:launch Launch files, scripts and initialization tools. (auto-assigned) component:common Common packages from the autoware-common repository. (auto-assigned) labels Jul 9, 2024
Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>
Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>
@kyoichi-sugahara kyoichi-sugahara added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Jul 9, 2024
Copy link

codecov bot commented Jul 9, 2024

Codecov Report

Attention: Patch coverage is 80.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 28.43%. Comparing base (6d0247e) to head (10320d1).
Report is 3 commits behind head on main.

Files Patch % Lines
...ware_behavior_path_planner/src/planner_manager.cpp 75.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7881      +/-   ##
==========================================
- Coverage   28.44%   28.43%   -0.01%     
==========================================
  Files        1591     1597       +6     
  Lines      116213   116265      +52     
  Branches    49613    49617       +4     
==========================================
+ Hits        33059    33063       +4     
- Misses      74141    74188      +47     
- Partials     9013     9014       +1     
Flag Coverage Δ *Carryforward flag
differential 12.52% <80.00%> (?)
total 28.44% <ø> (-0.01%) ⬇️ Carriedforward from 6d0247e

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

@kyoichi-sugahara kyoichi-sugahara merged commit 36a1d14 into autowarefoundation:main Jul 16, 2024
40 of 41 checks passed
@kyoichi-sugahara kyoichi-sugahara deleted the feat/prevent_infinite_loop branch July 16, 2024 02:39
kyoichi-sugahara added a commit to tier4/autoware.universe that referenced this pull request Jul 16, 2024
…ing scene module process (autowarefoundation#7881)

* prevent infinite loop

Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>

* calculate max_iteration_num from number of scene modules

Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>

* add doxygen explanation for calculateMaxIterationNum

Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>

---------

Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>
shmpwk pushed a commit to tier4/autoware.universe that referenced this pull request Jul 16, 2024
…ter (#1413)

feat(autoware_behavior_path_planner): prevent infinite loop in approving scene module process (autowarefoundation#7881)

* prevent infinite loop



* calculate max_iteration_num from number of scene modules



* add doxygen explanation for calculateMaxIterationNum



---------

Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>
Ariiees pushed a commit to Ariiees/autoware.universe that referenced this pull request Jul 22, 2024
…ing scene module process (autowarefoundation#7881)

* prevent infinite loop

Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>

* calculate max_iteration_num from number of scene modules

Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>

* add doxygen explanation for calculateMaxIterationNum

Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>

---------

Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>
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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants