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

refactor(goal_planner): use the PullOverPath, PullOverPathCandidates copied from ThreadData to reduce access #8994

Merged
merged 4 commits into from
Oct 3, 2024

Conversation

soblin
Copy link
Contributor

@soblin soblin commented Oct 1, 2024

Description

  • copy the pull_over_path / pull_over_path_candidates in ThreadSafeData in PullOverContextData once, in updateData to pull_over_context_data_
  • all the other methods use the pull_over_path / pull_over_path_candidates in PullOverContextData instead of accessing thread_safe_data_ every time

https://tier4.atlassian.net/wiki/spaces/~621c200f9c3cce006949b60e/pages/3286696258/GoalPlanner#%E8%89%B2%E3%82%93%E3%81%AA%E7%AE%87%E6%89%80%E3%81%A7.set_foo(%E2%80%A6)%E3%82%92%E5%91%BC%E3%81%B0%E3%81%AA%E3%81%84%E3%82%88%E3%81%86%E3%81%AB%E3%81%99%E3%82%8B%EF%BC%8E

Related links

Parent Issue:

How was this PR tested?

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

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

github-actions bot commented Oct 1, 2024

Thank you for contributing to the Autoware project!

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

Please ensure:

…copied from ThreadData to reduce access

Signed-off-by: Mamoru Sobue <[email protected]>
Signed-off-by: Mamoru Sobue <[email protected]>
Signed-off-by: Mamoru Sobue <[email protected]>
Signed-off-by: Mamoru Sobue <[email protected]>
@@ -540,21 +540,24 @@ void GoalPlannerModule::updateData()
path_reference_ = std::make_shared<PathWithLaneId>(getPreviousModuleOutput().reference_path);

const bool found_pull_over_path = thread_safe_data_.foundPullOverPath();
const std::optional<PullOverPath> pull_over_path =
std::optional<PullOverPath> pull_over_path_recv =
Copy link
Contributor Author

Choose a reason for hiding this comment

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

ここでthread_safe_data.get_pull_over_pathをコピーしてます

dynamic_target_objects);
dynamic_target_objects, std::move(pull_over_path_recv),
thread_safe_data_.get_pull_over_path_candidates());
const auto & ctx_data = context_data_.value();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

pull_over_path_candidates()もコピーしてきます.以降はctx_dataを使いまわします.
ほとんどの変更はthread_safe_dataへのアクセスがctx_dataへのアクセスに変わっているだけです

Copy link
Contributor

@kosuke55 kosuke55 left a comment

Choose a reason for hiding this comment

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

LGTM! thanks!

@soblin soblin added the tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Oct 3, 2024
@soblin soblin enabled auto-merge (squash) October 3, 2024 03:10
@soblin soblin merged commit b401eba into autowarefoundation:main Oct 3, 2024
37 of 38 checks passed
@soblin soblin deleted the fetch-pull-over-path-once2 branch October 3, 2024 03:23
Copy link

codecov bot commented Oct 3, 2024

Codecov Report

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

Project coverage is 26.16%. Comparing base (2b179f4) to head (fcc0eef).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...th_goal_planner_module/src/goal_planner_module.cpp 0.00% 75 Missing ⚠️
...r_path_goal_planner_module/goal_planner_module.hpp 0.00% 2 Missing ⚠️
...odule/pull_over_planner/pull_over_planner_base.hpp 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8994      +/-   ##
==========================================
- Coverage   26.17%   26.16%   -0.02%     
==========================================
  Files        1298     1302       +4     
  Lines       96986    97035      +49     
  Branches    39196    39189       -7     
==========================================
  Hits        25387    25387              
- Misses      68986    69031      +45     
- Partials     2613     2617       +4     
Flag Coverage Δ *Carryforward flag
differential 1.22% <0.00%> (?)
total 26.20% <ø> (+0.02%) ⬆️ Carriedforward from 2b179f4

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

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) tag: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.

2 participants