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

fix(avoidance): get nearest target object #3155

Merged

Conversation

satoshi-ota
Copy link
Contributor

@satoshi-ota satoshi-ota commented Mar 23, 2023

Description

Fix bug in searching nearest target object that satisfies following two conditions:

  1. should be avoid (otherwise, vehicle will collide with it.)
  2. is avoidable (there is enough space to avoid.)

Before this PR, the stop_target_object is overwitten unintentionally by bihind object since the loop never breaks.

  for (const auto & o : data.target_objects) {
    if (o.avoid_required && o.is_avoidable) {
      data.avoid_required = true;
      data.stop_target_object = o;
      break; // ADD THIS LINE
    }
  }

NOTE: target_objects is sorted by object.longitudinal, so target_objects.front() is the nearest object in target_objects.

Related links

Tests performed

Before this PR.

Since only one object is detected, the stop point is inserted in front of the object.

image

At the moment of detection behind object, the stop point moves to in front of the behind object. It is an unexpected behavior.

image

After this PR.

The stop point never changes even if the behind object is detected.

image

Notes for reviewers

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.

  • The PR follows the pull request guidelines.
  • The PR has been properly tested.
  • The PR has been reviewed by the code owners.

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.
  • The PR is ready for merge.

After all checkboxes are checked, anyone who has write access can merge the PR.

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
@github-actions github-actions bot added the component:planning Route planning, decision-making, and navigation. (auto-assigned) label Mar 23, 2023
@codecov
Copy link

codecov bot commented Mar 23, 2023

Codecov Report

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

Comparison is base (9a0a29d) 12.32% compared to head (fea016c) 12.31%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3155      +/-   ##
==========================================
- Coverage   12.32%   12.31%   -0.01%     
==========================================
  Files        1340     1340              
  Lines       93405    93396       -9     
  Branches    26751    26745       -6     
==========================================
- Hits        11509    11506       -3     
+ Misses      69744    69738       -6     
  Partials    12152    12152              
Flag Coverage Δ *Carryforward flag
differential 5.51% <ø> (?)
total 12.31% <ø> (-0.01%) ⬇️ Carriedforward from 731816b

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

Impacted Files Coverage Δ
...luator/diagnostic_converter/src/converter_node.cpp 60.00% <ø> (+0.62%) ⬆️
...er/src/scene_module/avoidance/avoidance_module.cpp 0.00% <ø> (ø)

... and 4 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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

Copy link
Contributor

@TakaHoribe TakaHoribe 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 merged commit 9e10e64 into autowarefoundation:main Mar 29, 2023
@satoshi-ota satoshi-ota deleted the fix/nearest-target-object-bug branch March 29, 2023 03:56
ktro2828 pushed a commit to ktro2828/autoware.universe that referenced this pull request Apr 7, 2023
Signed-off-by: satoshi-ota <satoshi.ota928@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)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants