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(dynamic_avoidance): precise cut-out decision #4527

Conversation

takayuki5168
Copy link
Contributor

@takayuki5168 takayuki5168 commented Aug 5, 2023

Description

More precise cut out decision of target objects for dynamic avoidance.
This PR checks if the object to cut out was inside the ego's path a few seconds before cutting out.

Tests performed

planning simulator

Effects on system behavior

Precise cut out decision of target objects for dynamic avoidance

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.

Summary by CodeRabbit

Release Notes:

  • New Feature: Added two new parameters to control cut-out decision for target objects in dynamic avoidance.
  • Refactor: Updated data structures and methods in the DynamicAvoidanceModule and TargetObjectsManager classes.

"In the realm of dynamic avoidance,
Parameters now grant precision.
Cut-out decisions, under control,
Target objects dance with a new role.
Refactored structures, methods refined,
Codebase shines, complexity declined."

@github-actions github-actions bot added the component:planning Route planning, decision-making, and navigation. (auto-assigned) label Aug 5, 2023
@takayuki5168 takayuki5168 changed the title Feat/dynamic avoidance precise cut out decision feat(dynamic_avoidance): precise cut-out decision Aug 5, 2023
@takayuki5168 takayuki5168 marked this pull request as ready for review August 5, 2023 02:03
@takayuki5168 takayuki5168 added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Aug 5, 2023
@codecov
Copy link

codecov bot commented Aug 5, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.01% ⚠️

Comparison is base (0fa8b57) 14.85% compared to head (32eaee2) 14.84%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4527      +/-   ##
==========================================
- Coverage   14.85%   14.84%   -0.01%     
==========================================
  Files        1521     1521              
  Lines      105231   105271      +40     
  Branches    32020    32047      +27     
==========================================
  Hits        15631    15631              
- Misses      72529    72571      +42     
+ Partials    17071    17069       -2     
Flag Coverage Δ *Carryforward flag
differential 13.15% <0.00%> (?)
total 14.85% <ø> (+<0.01%) ⬆️ Carriedforward from 0fa8b57

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

Files Changed Coverage Δ
...anner/include/behavior_path_planner/parameters.hpp 50.00% <ø> (ø)
...ule/dynamic_avoidance/dynamic_avoidance_module.hpp 0.00% <0.00%> (ø)
...or_path_planner/src/behavior_path_planner_node.cpp 26.71% <ø> (+0.09%) ⬆️
...ule/dynamic_avoidance/dynamic_avoidance_module.cpp 0.00% <0.00%> (ø)
...ner/src/scene_module/dynamic_avoidance/manager.cpp 0.00% <0.00%> (ø)

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

@github-actions
Copy link

github-actions bot commented Aug 6, 2023

Image description CodeRabbit

Walkthrough

The changes introduce updates to the DynamicAvoidanceModule class and related classes in the behavior_path_planner module. The DynamicAvoidanceModule class now has two new parameters in the DynamicAvoidanceParameters struct and additional fields in the DynamicAvoidanceObject struct. The DynamicAvoidanceObject struct also includes a new update method. The TargetObjectsManager class has a new updateObject method. The willObjectCutOut method in DynamicAvoidanceModule receives an extra parameter, and the getLateralLongitudinalOffset method receives two additional parameters. Additionally, the DynamicAvoidanceModuleManager class in manager.cpp introduces new parameters to control the cut-out decision for target objects in dynamic avoidance.

Changes

File Summary
planning/behavior_path_planner/include/behavior_path_planner/scene_module/dynamic_avoidance/dynamic_avoidance_module.hpp Updates the DynamicAvoidanceModule class with new parameters and updates the DynamicAvoidanceObject struct with additional fields and a new method. Also adds a new method to the TargetObjectsManager class.
planning/behavior_path_planner/src/scene_module/dynamic_avoidance/manager.cpp Introduces new parameters to control the cut-out decision for target objects in dynamic avoidance in the DynamicAvoidanceModuleManager class.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Image description CodeRabbit

Commits Files that changed from the base of the PR and between 4811435 and d0b923c commits.
Files selected (3)
  • planning/behavior_path_planner/include/behavior_path_planner/scene_module/dynamic_avoidance/dynamic_avoidance_module.hpp (6)
  • planning/behavior_path_planner/src/scene_module/dynamic_avoidance/dynamic_avoidance_module.cpp (7)
  • planning/behavior_path_planner/src/scene_module/dynamic_avoidance/manager.cpp (2)
Files not summarized due to errors (1)
  • planning/behavior_path_planner/src/scene_module/dynamic_avoidance/dynamic_avoidance_module.cpp (diff tokens exceeds limit)
Review comments generated (3)
  • Review: 2
  • LGTM: 1

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

Comment on lines +247 to +253
const auto target_objects_candidate = target_objects_manager_.getValidObjects();
target_objects_.clear();
for (const auto & target_object_candidate : target_objects_candidate) {
if (target_object_candidate.should_be_avoided) {
target_objects_.push_back(target_object_candidate);
}
}
Copy link

Choose a reason for hiding this comment

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

Image description CodeRabbit

The code for updating target_objects_ can be simplified using the std::copy_if algorithm. Instead of manually iterating over target_objects_candidate and checking the condition, you can use std::copy_if to copy the elements that satisfy the condition directly into target_objects_. Here's an example:

const auto target_objects_candidate = target_objects_manager_.getValidObjects();
target_objects_.clear();
std::copy_if(target_objects_candidate.begin(), target_objects_candidate.end(),
             std::back_inserter(target_objects_),
             [](const auto& target_object_candidate) {
                 return target_object_candidate.should_be_avoided;
             });

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
@takayuki5168 takayuki5168 force-pushed the feat/dynamic-avoidance-precise-cut-out-decision branch from d0b923c to 32eaee2 Compare August 6, 2023 18:08
@takayuki5168 takayuki5168 merged commit 5dfa9d2 into autowarefoundation:main Aug 7, 2023
@takayuki5168 takayuki5168 deleted the feat/dynamic-avoidance-precise-cut-out-decision branch August 7, 2023 01:35
takayuki5168 added a commit to tier4/autoware.universe that referenced this pull request Aug 9, 2023
…#4527)

* feat(dynamic_avoidance): precise cut-out decision

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

* update

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

* fix

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

* fix

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

---------

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
LeoDriveProject pushed a commit to leo-drive/autoware.universe.golf that referenced this pull request Aug 16, 2023
…#4527)

* feat(dynamic_avoidance): precise cut-out decision

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

* update

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

* fix

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

* fix

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

---------

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
takayuki5168 added a commit to tier4/autoware.universe that referenced this pull request Nov 26, 2023
…#4527)

* feat(dynamic_avoidance): precise cut-out decision

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

* update

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

* fix

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

* fix

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

---------

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
takayuki5168 added a commit to tier4/autoware.universe that referenced this pull request Dec 25, 2023
…#4527)

* feat(dynamic_avoidance): precise cut-out decision

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

* update

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

* fix

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

* fix

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>

---------

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
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