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): reduce call to isSafePath #8812

Conversation

soblin
Copy link
Contributor

@soblin soblin commented Sep 9, 2024

Description

depends #8795

Related links

How was this PR tested?

https://evaluation.tier4.jp/evaluation/reports/98dbc36e-c79a-53f0-a930-5aac27de1c95?project_id=prd_jt

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 Sep 9, 2024
Copy link

github-actions bot commented Sep 9, 2024

Thank you for contributing to the Autoware project!

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

Please ensure:

@soblin soblin changed the title Feat/goal planner/reduce call to is safe path refactor(goal_planner): reduce call to isSafePath Sep 9, 2024
@soblin soblin force-pushed the feat/goal-planner/reduce-call-to-isSafePath branch 2 times, most recently from 482e910 to fcbfc60 Compare September 10, 2024 02:28
@soblin soblin marked this pull request as ready for review September 10, 2024 04:21
@github-actions github-actions bot added component:perception Advanced sensor data processing and environment understanding. (auto-assigned) component:system System design and integration. (auto-assigned) component:map Map creation, storage, and loading. (auto-assigned) tag:require-cuda-build-and-test labels Sep 10, 2024
@soblin soblin force-pushed the feat/goal-planner/reduce-call-to-isSafePath branch from 9e8dad4 to bc83821 Compare September 10, 2024 06:45
@github-actions github-actions bot removed component:perception Advanced sensor data processing and environment understanding. (auto-assigned) component:system System design and integration. (auto-assigned) component:map Map creation, storage, and loading. (auto-assigned) tag:require-cuda-build-and-test labels Sep 10, 2024
Signed-off-by: Mamoru Sobue <[email protected]>
Comment on lines 889 to 891
const auto & context_data = context_data_.has_value()
? context_data_.value()
: PullOverContextData(std::make_pair(true, true));
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 auto & context_data = context_data_.has_value()
? context_data_.value()
: PullOverContextData(std::make_pair(true, true));
const auto context_data = context_data_.has_value()
? context_data_.value()
: PullOverContextData(std::make_pair(true, true));

temporary object should not be bound

if (
hasDeviatedFromLastPreviousModulePath(local_planner_data) &&
// TODO(soblin):
Copy link
Contributor

Choose a reason for hiding this comment

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

please writer the details of todo

@@ -505,6 +516,9 @@ class GoalPlannerModule : public SceneModuleInterface
// TODO(Mamoru Sobue): isSafePath() modifies ThreadSafeData::check_collision, avoid this mutable
mutable ThreadSafeData thread_safe_data_;

// TODO(soblin): organize part of thread_safe_data and previous data to PullOverContextData
Copy link
Contributor

Choose a reason for hiding this comment

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

agree!

struct PreviousPullOverData
{
  struct SafetyStatus
  {
    std::optional<rclcpp::Time> safe_start_time{};
    bool is_safe{false};
  };

  void reset()
  {
    safety_status = SafetyStatus{};
    deciding_path_status = DecidingPathStatusWithStamp{};
  }

  SafetyStatus safety_status{};
  DecidingPathStatusWithStamp deciding_path_status{};
};

is similar to ContextData

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 will move PreviousPullOverData later in coming PRs.

if (!context_data_) {
RCLCPP_ERROR(getLogger(), " [pull_over] postProcess() is called without valid context_data");
}
const auto & context_data = context_data_.has_value()
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 auto & context_data = context_data_.has_value()
const auto context_data = context_data_.has_value()

RCLCPP_ERROR(
getLogger(), " [pull_over] planWaitingApproval() is called without valid context_data");
}
const auto & context_data = context_data_.has_value()
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 auto & context_data = context_data_.has_value()
const auto context_data = context_data_.has_value()

Signed-off-by: Mamoru Sobue <[email protected]>
@soblin
Copy link
Contributor Author

soblin commented Sep 10, 2024

I applied suggestions

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

@kosuke55 kosuke55 added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Sep 10, 2024
@soblin soblin enabled auto-merge (squash) September 10, 2024 14:58
@soblin soblin merged commit 5e18705 into autowarefoundation:main Sep 10, 2024
37 of 38 checks passed
@soblin soblin deleted the feat/goal-planner/reduce-call-to-isSafePath branch September 10, 2024 15:05
Copy link

codecov bot commented Sep 10, 2024

Codecov Report

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

Project coverage is 25.22%. Comparing base (2fd7185) to head (3f6db4b).
Report is 15 commits behind head on main.

Files with missing lines Patch % Lines
...th_goal_planner_module/src/goal_planner_module.cpp 0.00% 38 Missing ⚠️
...r_path_goal_planner_module/goal_planner_module.hpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8812      +/-   ##
==========================================
- Coverage   25.23%   25.22%   -0.01%     
==========================================
  Files        1325     1329       +4     
  Lines       98827    98878      +51     
  Branches    39682    39691       +9     
==========================================
+ Hits        24939    24943       +4     
- Misses      71327    71378      +51     
+ Partials     2561     2557       -4     
Flag Coverage Δ *Carryforward flag
differential 0.69% <0.00%> (?)
total 25.24% <ø> (+0.01%) ⬆️ Carriedforward from 2fd7185

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