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(lane_change): remove overlapping preceding lanes #9526

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

zulfaqar-azmi-t4
Copy link
Contributor

Description

When the lanes are short, the preceding lane might overlap with the current lanes, as shown in the video below.

This could potentially affect the safety check results. To avoid this, we should remove the overlapping lane.

Before

Preceding lanes (Dark blue lanes) overlap current lanes.

cap-.2024-11-29-19-26-53.mp4

After

Preceding lanes no longer overlaps current lanes.

cap-.2024-11-29-19-24-40.mp4

Related links

Parent Issue:

  • Link

How was this PR tested?

Notes for reviewers

None.

Interface changes

None.

Effects on system behavior

None.

@github-actions github-actions bot added the component:planning Route planning, decision-making, and navigation. (auto-assigned) label Nov 29, 2024
Copy link

github-actions bot commented Nov 29, 2024

Thank you for contributing to the Autoware project!

🚧 If your pull request is in progress, switch it to draft mode.

Please ensure:

@maxime-clem maxime-clem added the tag:run-build-and-test-differential Mark to enable build-and-test-differential workflow. (used-by-ci) label Dec 2, 2024
Copy link

codecov bot commented Dec 2, 2024

Codecov Report

Attention: Patch coverage is 92.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 29.50%. Comparing base (8d9ca0e) to head (77fed5d).

Files with missing lines Patch % Lines
...havior_path_lane_change_module/src/utils/utils.cpp 91.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #9526   +/-   ##
=======================================
  Coverage   29.49%   29.50%           
=======================================
  Files        1444     1446    +2     
  Lines      108530   108581   +51     
  Branches    41406    41416   +10     
=======================================
+ Hits        32012    32035   +23     
- Misses      73397    73425   +28     
  Partials     3121     3121           
Flag Coverage Δ *Carryforward flag
differential 22.20% <92.00%> (?)
total 29.49% <ø> (-0.01%) ⬇️ Carriedforward from 8d9ca0e

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

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

Comment on lines +1285 to +1302
std::unordered_set<lanelet::Id> not_connected_ids;
for (const auto [current_lane, next_lane] : ranges::views::zip(
non_overlapping_lanes, non_overlapping_lanes | ranges::views::drop(1))) {
const auto next_lanes = route_handler_ptr->getNextLanelets(current_lane);

const auto is_connected = ranges::any_of(
next_lanes, [next_id = next_lane.id()](const auto & lane) { return lane.id() == next_id; });

if (!is_connected) {
not_connected_ids.insert(current_lane.id());
}
}

// Step 3: Remove disconnected lanes
auto connected_lanes =
non_overlapping_lanes | ranges::views::remove_if([&](const lanelet::ConstLanelet & lane) {
return not_connected_ids.find(lane.id()) != not_connected_ids.end();
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain whats the purpose of this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When we removed the overlapping lanes, we might ended up lanes that is not connected. For example

Original: L4, L3, L2, L1. Assume overlapping is L2.
Overlapping removed: L1, L3, L4

Since L1 and L3 is not directly connected, we should remove L1 from the list, which yield
Connected: L4, L3.

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.

3 participants