-
Notifications
You must be signed in to change notification settings - Fork 657
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
base: main
Are you sure you want to change the base?
fix(lane_change): remove overlapping preceding lanes #9526
Conversation
Thank you for contributing to the Autoware project! 🚧 If your pull request is in progress, switch it to draft mode. Please ensure:
|
Codecov ReportAttention: Patch coverage is
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
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Sentry. |
planning/behavior_path_planner/autoware_behavior_path_lane_change_module/src/utils/utils.cpp
Show resolved
Hide resolved
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(); | ||
}); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Signed-off-by: Zulfaqar Azmi <[email protected]>
Signed-off-by: Zulfaqar Azmi <[email protected]>
d1be3e9
to
77fed5d
Compare
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:
How was this PR tested?
Notes for reviewers
None.
Interface changes
None.
Effects on system behavior
None.