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(behavior_path_planner): refactor planWithPriority in start_planner #5393

Conversation

kyoichi-sugahara
Copy link
Contributor

@kyoichi-sugahara kyoichi-sugahara commented Oct 24, 2023

Description

minor refactor the function planWithPriotity
the PR should be merged.


🤖 Generated by Copilot at 6ccd8a2

This pull request enhances the start planner module, which plans a path for the ego vehicle to pull out of a parking spot. It improves the readability and maintainability of the code by introducing type aliases, renaming fields and methods, and refactoring the logic with new private methods. It also changes the compatibility check with other scene modules based on the vehicle's direction.

Tests performed

Effects on system behavior

Not applicable.

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.

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

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

Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>
Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>
Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>
@github-actions github-actions bot added the component:planning Route planning, decision-making, and navigation. (auto-assigned) label Oct 24, 2023
Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>
Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>
Comment on lines 500 to 504
for (const auto & pair : order_priority) {
if (findPullOutPath(
start_pose_candidates, pair.first, pair.second, refined_start_pose, goal_pose))
return;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I prefer

Suggested change
for (const auto & pair : order_priority) {
if (findPullOutPath(
start_pose_candidates, pair.first, pair.second, refined_start_pose, goal_pose))
return;
}
for (const auto & [index, planner] : order_priority) {
if (findPullOutPath(
start_pose_candidates, index, planner, refined_start_pose, goal_pose))
return;
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't know this way and looks better!
changed in 791145e

…start_planner_module.cpp

Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com>
const auto make_loop_order_planner_first = [&]() {
PriorityOrder order_priority;
PriorityOrder StartPlannerModule::determinePriorityOrder(
const std::string & search_priority, size_t candidates_size)
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
const std::string & search_priority, size_t candidates_size)
const std::string & search_priority, const size_t candidates_size)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed in 791145e

Comment on lines 584 to 594
void StartPlannerModule::updateStatusWithNextPath(
const behavior_path_planner::PullOutPath & path, const Pose & start_pose,
const std::shared_ptr<PullOutPlannerBase> & planner)
{
const std::lock_guard<std::mutex> lock(mutex_);
status_.driving_forward = false;
status_.found_pull_out_path = true;
status_.pull_out_path = path;
status_.pull_out_start_pose = start_pose;
status_.planner_type = planner->getPlannerType();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

nits:
giving planner_type instead of planner is enough

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree! thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

changed in 791145e

Signed-off-by: kyoichi-sugahara <kyoichi.sugahara@tier4.jp>
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.

thanks!!

@kyoichi-sugahara kyoichi-sugahara added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Oct 25, 2023
@codecov
Copy link

codecov bot commented Oct 25, 2023

Codecov Report

Attention: 118 lines in your changes are missing coverage. Please review.

Comparison is base (f400b91) 14.78% compared to head (791145e) 14.81%.
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5393      +/-   ##
==========================================
+ Coverage   14.78%   14.81%   +0.02%     
==========================================
  Files        1661     1662       +1     
  Lines      115453   115438      -15     
  Branches    35644    35634      -10     
==========================================
+ Hits        17068    17099      +31     
+ Misses      79153    79093      -60     
- Partials    19232    19246      +14     
Flag Coverage Δ *Carryforward flag
differential 12.35% <7.81%> (?)
total 14.81% <ø> (+0.03%) ⬆️ Carriedforward from 7c3bde1

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

Files Coverage Δ
...ehavior_velocity_intersection_module/src/debug.cpp 0.00% <ø> (ø)
...avior_velocity_intersection_module/src/manager.cpp 14.33% <ø> (ø)
...ity_intersection_module/src/scene_intersection.cpp 0.00% <ø> (ø)
...ity_intersection_module/src/scene_intersection.hpp 0.00% <ø> (ø)
...behavior_velocity_intersection_module/src/util.cpp 0.00% <ø> (ø)
...ior_velocity_intersection_module/src/util_type.hpp 0.00% <ø> (ø)
...cene_module/start_planner/start_planner_module.hpp 0.00% <0.00%> (ø)
.../scene_module/goal_planner/goal_planner_module.hpp 28.30% <0.00%> (-0.55%) ⬇️
...planner/src/scene_module/start_planner/manager.cpp 5.57% <0.00%> (ø)
...ner/src/utils/path_safety_checker/safety_check.cpp 22.43% <0.00%> (+2.20%) ⬆️
... and 3 more

... and 24 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kyoichi-sugahara kyoichi-sugahara merged commit 6e60536 into autowarefoundation:main Oct 25, 2023
@kyoichi-sugahara kyoichi-sugahara deleted the refactor/plan_with_priority branch October 25, 2023 04:54
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.

2 participants