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): fix invalid road bound distance calculation #6781

Merged
merged 1 commit into from
Apr 11, 2024

Conversation

satoshi-ota
Copy link
Contributor

@satoshi-ota satoshi-ota commented Apr 9, 2024

Background

The avoidance module calculates distance to drivable bound by using tier4_autoware_utils::intersection with following step.

  1. check object offset direction based on current path. (fig: on left)
  2. calculate overhang point (=p1). (fig: black point)
  3. calculate offset point (=p2) based on overhang points by using tier4_autoware_utils::calcOffsetPose.
  4. calculate intersect point (=p3) between line p1-p2 and drivable bound.
  5. calculate distance (=D) p1 to p3.

In most case (fig: nominal case), we can find intersect by following logic. But, in edge case, we can't.

        const auto p2 =
          calcOffsetPose(p_tmp, 0.0, (isOnRight(object) ? 100.0 : -100.0), 0.0).position;
        const auto opt_intersect =
          tier4_autoware_utils::intersect(p1.second, p2, bound.at(i - 1), bound.at(i));

Then, there is following logic as well to calculate D'.

        const auto p2 =
          calcOffsetPose(p_tmp, 0.0, (isOnRight(object) ? -100.0 : 100.0), 0.0).position;
        const auto opt_intersect =
          tier4_autoware_utils::intersect(p1.second, p2, bound.at(i - 1), bound.at(i));

IMG_0043

Description

BUG: The module couldn't calculate distance to drivable bound properly. As a result, the module didn't create avoidance path even when there was enough space to avoid.

Screenshot from 2024-04-09 11-28-17

This issue caused by unexpected intersetion point calculation in following logic. And, I decreased the hard coded value to 1m in order not to get unexpected intersection point.

        const auto p2 =
          calcOffsetPose(p_tmp, 0.0, (isOnRight(object) ? -100.0 : 100.0), 0.0).position;
        const auto opt_intersect =
          tier4_autoware_utils::intersect(p1.second, p2, bound.at(i - 1), bound.at(i));

IMG_0044

Tests performed

simplescreenrecorder-2024-04-09_16.34.49.mp4

Effects on system behavior

Fix bug.

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.

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 Apr 9, 2024
@satoshi-ota satoshi-ota marked this pull request as ready for review April 10, 2024 10:29
@satoshi-ota satoshi-ota changed the title fix(avoidance): fix invalid road shoulder distance calculation fix(avoidance): fix invalid road bound distance calculation Apr 10, 2024
@shmpwk shmpwk added the tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Apr 11, 2024
Copy link
Contributor

@shmpwk shmpwk left a comment

Choose a reason for hiding this comment

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

LGTM!!

My note

@satoshi-ota satoshi-ota merged commit 06bb9bd into autowarefoundation:main Apr 11, 2024
49 of 51 checks passed
@satoshi-ota satoshi-ota deleted the fix/road-shoulder-dist branch April 11, 2024 06:38
satoshi-ota added a commit to tier4/autoware.universe that referenced this pull request Apr 11, 2024
…foundation#6781)

fix(avoidance): fix invalid road shoulder distance calculation

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
shmpwk pushed a commit to tier4/autoware.universe that referenced this pull request Apr 11, 2024
…foundation#6781) (#1250)

fix(avoidance): fix invalid road shoulder distance calculation

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
esteve pushed a commit that referenced this pull request Apr 12, 2024
fix(avoidance): fix invalid road shoulder distance calculation

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
satoshi-ota added a commit to tier4/autoware.universe that referenced this pull request Apr 18, 2024
…foundation#6781)

fix(avoidance): fix invalid road shoulder distance calculation

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
satoshi-ota added a commit to tier4/autoware.universe that referenced this pull request May 2, 2024
…foundation#6781)

fix(avoidance): fix invalid road shoulder distance calculation

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
karishma1911 pushed a commit to Interplai/autoware.universe that referenced this pull request Jun 3, 2024
…foundation#6781)

fix(avoidance): fix invalid road shoulder distance calculation

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) tag: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.

None yet

2 participants