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(avoidance): improve avoidance stop & decel behavior #4141

Merged

Conversation

satoshi-ota
Copy link
Contributor

@satoshi-ota satoshi-ota commented Jul 2, 2023

Description

🤖 Generated by Copilot at 62cc273

This pull request enhances the avoidance behavior of the behavior path planner by adding new parameters, simplifying the code, and improving the logic for the speed and distance of the vehicle when avoiding obstacles. It modifies the avoidance.param.yaml configuration file, the AvoidanceParameters struct, the AvoidanceHelper and PathShifter classes, and the avoidance_module.cpp and manager.cpp source files.

Improvement

The avoidance module insert decel speed in prepare section so that the avoidance path always can be generated.

Screenshot from 2023-07-03 08-59-34

simplescreenrecorder-2023-07-03_09.18.42.mp4

Previous behavior

Since the avoidance module inserts only stop point, sometimes the ego speed exceeds feasible condition and the avoidance path can't be generated.

image

Please approve ⬇️ before this PR.
autowarefoundation/autoware_launch#429

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.

@github-actions github-actions bot added the component:planning Route planning, decision-making, and navigation. (auto-assigned) label Jul 2, 2023
@satoshi-ota satoshi-ota force-pushed the feat/avoidance-stop branch from 62cc273 to 2d06d06 Compare July 2, 2023 23:36
@satoshi-ota satoshi-ota marked this pull request as ready for review July 3, 2023 00:27
@codecov
Copy link

codecov bot commented Jul 3, 2023

Codecov Report

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

Comparison is base (681ba74) 14.30% compared to head (d5eafc1) 14.30%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4141      +/-   ##
==========================================
- Coverage   14.30%   14.30%   -0.01%     
==========================================
  Files        1571     1571              
  Lines      108373   108406      +33     
  Branches    31374    31396      +22     
==========================================
  Hits        15505    15505              
- Misses      76017    76045      +28     
- Partials    16851    16856       +5     
Flag Coverage Δ *Carryforward flag
differential 13.46% <0.00%> (?)
total 14.31% <ø> (+<0.01%) ⬆️ Carriedforward from 681ba74

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

Impacted Files Coverage Δ
..._planner/utils/avoidance/avoidance_module_data.hpp 0.00% <ø> (ø)
...e/behavior_path_planner/utils/avoidance/helper.hpp 31.03% <0.00%> (+0.35%) ⬆️
...r_path_planner/utils/path_shifter/path_shifter.hpp 0.00% <ø> (ø)
...r_path_planner/src/marker_util/avoidance/debug.cpp 4.57% <0.00%> (-0.04%) ⬇️
...er/src/scene_module/avoidance/avoidance_module.cpp 11.49% <0.00%> (-0.16%) ⬇️
...ath_planner/src/scene_module/avoidance/manager.cpp 7.46% <0.00%> (-0.23%) ⬇️
...ehavior_path_planner/src/utils/avoidance/utils.cpp 5.76% <0.00%> (-0.05%) ⬇️
...th_planner/src/utils/path_shifter/path_shifter.cpp 6.79% <0.00%> (-0.08%) ⬇️
system/default_ad_api/src/vehicle.cpp 14.08% <ø> (+0.19%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -3350,23 +3351,64 @@ void AvoidanceModule::insertPrepareVelocity(ShiftedPath & shifted_path) const
{
const auto & data = avoidance_data_;

// do nothing if there is no avoidance target.
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️


// calculate shift length for front object.
const auto & vehicle_width = planner_data_->parameters.vehicle_width;
const auto t = utils::getHighestProbLabel(object.object.classification);
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 t = utils::getHighestProbLabel(object.object.classification);
const auto object_type = utils::getHighestProbLabel(object.object.classification);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Rename all same variable in 7dfd756.

const double v_target = PathShifter::calcFeasibleVelocityFromJerk(
shift_length, parameters_->nominal_lateral_jerk, shift_longitudinal_distance);
const double v_original = shifted_path.path.points.at(i).point.longitudinal_velocity_mps;
const double v_insert = std::max(v_target - parameters_->buf_slow_down_speed, lower_speed);
Copy link
Contributor

Choose a reason for hiding this comment

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

@satoshi-ota
I have a simple question: why is this buffer parameter necessary? I'm curious as to in what situation we would need to tune the buf_slow_down_speed parameter rather than lowering the nominal_lateral_jerk.

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 added parameter description in b0ff9f6. Please see that 👍

Copy link
Contributor

@kyoichi-sugahara kyoichi-sugahara left a comment

Choose a reason for hiding this comment

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

LGTM
(I left comment about param but i guess it will be explained in README in other PR?)

@satoshi-ota satoshi-ota force-pushed the feat/avoidance-stop branch from 3717a69 to b0ff9f6 Compare July 4, 2023 23:49
@github-actions github-actions bot added the type:documentation Creating or refining documentation. (auto-assigned) label Jul 4, 2023
Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
… have to avoid

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
@satoshi-ota satoshi-ota force-pushed the feat/avoidance-stop branch from b0ff9f6 to d5eafc1 Compare July 5, 2023 02:55
@satoshi-ota satoshi-ota merged commit e95909d into autowarefoundation:main Jul 5, 2023
@satoshi-ota satoshi-ota deleted the feat/avoidance-stop branch July 5, 2023 09:57
satoshi-ota added a commit to satoshi-ota/autoware.universe that referenced this pull request Jul 7, 2023
…ndation#4141)

* feat(path_shifter): add utils

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>

* feat(avoidance): shorten avoidance stop distance

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>

* feat(avoidance): insert slow down speed

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>

* fix(avoidance): don't set stoppable=true for objects that ego doesn't have to avoid

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>

* refactor(avoidance): rename unreadable variable name

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>

* docs(avoidance): add new parameter description

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>

---------

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
1222-takeshi pushed a commit to tier4/autoware.universe that referenced this pull request Jul 7, 2023
…ndation#4141) (#651)

* feat(path_shifter): add utils



* feat(avoidance): shorten avoidance stop distance



* feat(avoidance): insert slow down speed



* fix(avoidance): don't set stoppable=true for objects that ego doesn't have to avoid



* refactor(avoidance): rename unreadable variable name



* docs(avoidance): add new parameter description



---------

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
SaltUhey pushed a commit to SaltUhey/autoware.universe that referenced this pull request Apr 11, 2024
…arefoundation#4141)

Signed-off-by: Ryohsuke Mitsudome <ryohsuke.mitsudome@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) type:documentation Creating or refining documentation. (auto-assigned)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants