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): make detection area dynamically #5303

Conversation

satoshi-ota
Copy link
Contributor

@satoshi-ota satoshi-ota commented Oct 13, 2023

Description

🤖 Generated by Copilot at 36f63a0

This pull request refactors and improves the avoidance target filtering logic for the behavior_path_planner node. It introduces new parameters to configure the detection area for avoidance and lane change, and uses a dynamic detection range based on the vehicle speed and jerk limit. It also simplifies and optimizes the object separation code in utils.cpp and avoidance_module.cpp.

Please review following PR at first:
autowarefoundation/autoware_launch#634


Main motivation: Avoidance module would like to generate avoidance path only for objects which should be avoid right now. For example, don't want to generate avoidance path for far objects if the ego is waiting for red traffic light.

Screenshot from 2023-10-16 18-14-31

  double getForwardDetectionRange() const
  {
    if (parameters_->use_static_detection_area) {
      return parameters_->object_check_max_forward_distance;
    }

    const auto max_shift_length = std::max(
      std::abs(parameters_->max_right_shift_length), std::abs(parameters_->max_left_shift_length));
    const auto dynamic_distance = PathShifter::calcLongitudinalDistFromJerk(
      max_shift_length, getLateralMinJerkLimit(), getEgoSpeed());

    // 1.5 is a margin factor for detection area longitudinal distance.
    return std::clamp(
      1.5 * dynamic_distance, parameters_->object_check_min_forward_distance,
      parameters_->object_check_max_forward_distance);
  }
simplescreenrecorder-2023-10-16_18.13.22.mp4

Tests performed

Effects on system behavior

Nothing.

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 Oct 13, 2023
@satoshi-ota satoshi-ota force-pushed the feat/change-detection-area-dynimic branch 2 times, most recently from aa82c90 to 8098ef5 Compare October 16, 2023 08:27
@satoshi-ota satoshi-ota added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Oct 16, 2023
@satoshi-ota satoshi-ota marked this pull request as ready for review October 16, 2023 09:20
@rej55
Copy link
Contributor

rej55 commented Oct 16, 2023

@satoshi-ota
Copy link
Contributor Author

satoshi-ota commented Oct 16, 2023

@satoshi-ota It seems that the following file also needs to be changed. https://github.com/autowarefoundation/autoware.universe/blob/main/planning/behavior_path_planner/config/avoidance/avoidance.param.yaml

Oh. You're right! Thanks. -> DONE

@satoshi-ota satoshi-ota removed the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Oct 16, 2023
@satoshi-ota satoshi-ota force-pushed the feat/change-detection-area-dynimic branch from 8098ef5 to a11c9db Compare October 16, 2023 10:02
Copy link
Contributor

@rej55 rej55 left a comment

Choose a reason for hiding this comment

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

LGTM

@satoshi-ota satoshi-ota force-pushed the feat/change-detection-area-dynimic branch from a11c9db to 22f254f Compare October 17, 2023 05:24
@satoshi-ota satoshi-ota added the run:build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Oct 17, 2023
@codecov
Copy link

codecov bot commented Oct 17, 2023

Codecov Report

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

Comparison is base (3a1d480) 14.77% compared to head (22f254f) 14.77%.
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5303      +/-   ##
==========================================
- Coverage   14.77%   14.77%   -0.01%     
==========================================
  Files        1663     1663              
  Lines      115150   115165      +15     
  Branches    35519    35530      +11     
==========================================
+ Hits        17013    17014       +1     
- Misses      78930    78938       +8     
- Partials    19207    19213       +6     
Flag Coverage Δ *Carryforward flag
differential 12.23% <7.14%> (?)
total 14.77% <ø> (+<0.01%) ⬆️ Carriedforward from 3a1d480

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

Files Coverage Δ
..._planner/utils/avoidance/avoidance_module_data.hpp 0.00% <ø> (ø)
...er/src/scene_module/avoidance/avoidance_module.cpp 12.28% <33.33%> (ø)
...ehavior_path_planner/src/utils/avoidance/utils.cpp 11.48% <0.00%> (ø)
...e/behavior_path_planner/utils/avoidance/helper.hpp 23.85% <14.28%> (-0.66%) ⬇️
...ath_planner/src/scene_module/avoidance/manager.cpp 5.86% <0.00%> (-0.09%) ⬇️
...h_planner/src/scene_module/lane_change/manager.cpp 4.21% <0.00%> (-0.08%) ⬇️

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

@satoshi-ota satoshi-ota merged commit b71b04e into autowarefoundation:main Oct 17, 2023
30 of 34 checks passed
@satoshi-ota satoshi-ota deleted the feat/change-detection-area-dynimic branch October 17, 2023 10:08
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