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): check next & previous road shoulder linestring #3691

Merged

Conversation

satoshi-ota
Copy link
Contributor

@satoshi-ota satoshi-ota commented May 12, 2023

Description

Currently, avoidance module checks the distance between the object and closest lanelet's most left (or right) linestring.
However, the distance2d function returns unexpected value for avoidance module in the following case.

rviz_screenshot_2023_05_12-15_58_17

It is better to check not only closest lanelet's most left linestring but also next & previous linestring so that distance2d function return exact distance between the object and road shoulder.

rviz_screenshot_2023_05_12-18_14_13

Tests performed

Effects on system behavior

Improve avoidance path generation.

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 May 12, 2023
@satoshi-ota satoshi-ota changed the title feat(avoidance): check next & previous road shoulder feat(avoidance): check next & previous road shoulder linestring May 12, 2023
const auto merge_two_line = [](const auto & a, const auto & b) {
lanelet::Points3d new_points;
for (const auto & p : a) {
new_points.emplace_back(lanelet::utils::getId(), p.basicPoint());
Copy link
Contributor

Choose a reason for hiding this comment

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

memo:
lane id is not needed to calculate distance. so just push the dummy initial id.

Comment on lines 699 to 695
const auto lines =
rh->getFurthestLinestring(previous_lanelet.front(), get_right, get_left, get_opposite);
if (isOnRight(o)) {
target_line = merge_two_line(target_line, lines.back());
} else {
target_line = merge_two_line(target_line, lines.front());
}
Copy link
Contributor

Choose a reason for hiding this comment

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

memo:
getFurthestLinestring() push linestring in the order of right -> left. so the target object is on the right side,need to get left line which lines.back().
https://github.com/autowarefoundation/autoware.universe/blob/main/planning/route_handler/src/route_handler.cpp#L1166

Copy link
Contributor

@kosuke55 kosuke55 left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov
Copy link

codecov bot commented May 12, 2023

Codecov Report

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

Comparison is base (5e5c4dd) 14.56% compared to head (e1a71aa) 14.55%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3691      +/-   ##
==========================================
- Coverage   14.56%   14.55%   -0.01%     
==========================================
  Files        1409     1409              
  Lines       99290    99313      +23     
  Branches    29347    29364      +17     
==========================================
  Hits        14458    14458              
- Misses      69247    69270      +23     
  Partials    15585    15585              
Flag Coverage Δ *Carryforward flag
differential 13.11% <0.00%> (?)
total 14.56% <ø> (+<0.01%) ⬆️ Carriedforward from 5e5c4dd

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

Impacted Files Coverage Δ
...er/src/scene_module/avoidance/avoidance_module.cpp 3.64% <0.00%> (+<0.01%) ⬆️
...ehavior_path_planner/src/utils/avoidance/utils.cpp 3.58% <0.00%> (-0.24%) ⬇️

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

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/check-road-shoulder branch from 3938b22 to e1a71aa Compare May 13, 2023 08:53
@satoshi-ota satoshi-ota merged commit 6d28c23 into autowarefoundation:main May 14, 2023
@satoshi-ota satoshi-ota deleted the feat/check-road-shoulder branch May 14, 2023 23:38
satoshi-ota added a commit to satoshi-ota/autoware.universe that referenced this pull request May 15, 2023
…warefoundation#3691)

* feat(route_hander): move public

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

* feat(avoidance): check road next & previous road shoulder

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

---------

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
satoshi-ota added a commit to tier4/autoware.universe that referenced this pull request Jun 1, 2023
…warefoundation#3691)

* feat(route_hander): move public

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

* feat(avoidance): check road next & previous road shoulder

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

---------

Signed-off-by: satoshi-ota <satoshi.ota928@gmail.com>
satoshi-ota added a commit to satoshi-ota/autoware.universe that referenced this pull request Jun 20, 2023
…warefoundation#3691)

* feat(route_hander): move public

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

* feat(avoidance): check road next & previous road shoulder

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

---------

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.

2 participants