Repository navigation
fix(autoware_motion_velocity_out_of_lane_module): fix ego footprint collapse from negative overhangs (#13536) - #13543
Merged
maxime-clem merged 1 commit intoOct 26, 2026
Conversation
…ollapse from negative overhangs (autowarefoundation#13536) `out_of_lane_module` initializes `pp.rear_offset` and `pp.right_offset` from `vehicle_info.min_longitudinal_offset_m` and `vehicle_info.min_lateral_offset_m`, which are negative offsets relative to base_link. In `make_base_footprint`, passing these signed offsets directly to `vehicle_info.createFootprint` as `rear_overhang_m` and `right_overhang_m` caused double negation because `createFootprint` expects positive overhang lengths and negates them internally. This caused the rear edge to flip forward and the right edge to flip to the positive y-coordinate (+0.948 m), collapsing the footprint polygon into a zero-width line segment with 0.0 m^2 area and preventing out-of-lane overlap detection from functioning. Fix this by: 1. Passing non-negative overhangs using `std::abs` for rear and right offsets to `VehicleInfo`. 2. Applying asymmetric `extra_left_offset` and `extra_right_offset` directly to `left_overhang_m` and `right_overhang_m` rather than distorting them through an averaged symmetric `lat_margin`. 3. Using `std::abs` on `right_offset` and `rear_offset` in `lanelets_selection.cpp` and `filter_predicted_objects.cpp`. 4. Adding unit regression tests in `test/test_footprint.cpp` validating footprint area, bounding box coordinates, offset handling, and lanelet polygon overlap detection. Signed-off-by: paneendrakumar0 <paneendra100@gmail.com>
paneendrakumar0
requested review from
maxime-clem,
mkquda,
shmpwk,
soblin,
takayuki5168,
tkimura4 and
zulfaqar-azmi-t4
as code owners
October 26, 2026 04:21
|
Thank you for contributing to the Autoware project! 🚧 If your pull request is in progress, switch it to draft mode. Please ensure:
|
maxime-clem
approved these changes
Oct 26, 2026
maxime-clem
left a comment
Contributor
There was a problem hiding this comment.
Thank you for your contribution.
I tested in Psim and confirmed with the OutOfLane debug markers that the feature was broken and is fixed by this PR.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13543 +/- ##
==========================================
+ Coverage 38.31% 38.32% +0.01%
==========================================
Files 2034 2034
Lines 141864 141863 -1
==========================================
+ Hits 54349 54368 +19
+ Misses 87515 87495 -20
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
paulsohn-github-app Bot
pushed a commit
to paulsohn/autoware_universe_planning_2
that referenced
this pull request
Oct 26, 2026
…ollapse from negative overhangs (autowarefoundation/autoware_universe#13536) (autowarefoundation/autoware_universe#13543) `out_of_lane_module` initializes `pp.rear_offset` and `pp.right_offset` from `vehicle_info.min_longitudinal_offset_m` and `vehicle_info.min_lateral_offset_m`, which are negative offsets relative to base_link. In `make_base_footprint`, passing these signed offsets directly to `vehicle_info.createFootprint` as `rear_overhang_m` and `right_overhang_m` caused double negation because `createFootprint` expects positive overhang lengths and negates them internally. This caused the rear edge to flip forward and the right edge to flip to the positive y-coordinate (+0.948 m), collapsing the footprint polygon into a zero-width line segment with 0.0 m^2 area and preventing out-of-lane overlap detection from functioning. Fix this by: 1. Passing non-negative overhangs using `std::abs` for rear and right offsets to `VehicleInfo`. 2. Applying asymmetric `extra_left_offset` and `extra_right_offset` directly to `left_overhang_m` and `right_overhang_m` rather than distorting them through an averaged symmetric `lat_margin`. 3. Using `std::abs` on `right_offset` and `rear_offset` in `lanelets_selection.cpp` and `filter_predicted_objects.cpp`. 4. Adding unit regression tests in `test/test_footprint.cpp` validating footprint area, bounding box coordinates, offset handling, and lanelet polygon overlap detection. Signed-off-by: paneendrakumar0 <paneendra100@gmail.com>
shmpwk
pushed a commit
to tier4/pilot_auto_planning
that referenced
this pull request
Nov 5, 2026
…ollapse from negative overhangs (autowarefoundation/autoware_universe#13536) (autowarefoundation/autoware_universe#13543) `out_of_lane_module` initializes `pp.rear_offset` and `pp.right_offset` from `vehicle_info.min_longitudinal_offset_m` and `vehicle_info.min_lateral_offset_m`, which are negative offsets relative to base_link. In `make_base_footprint`, passing these signed offsets directly to `vehicle_info.createFootprint` as `rear_overhang_m` and `right_overhang_m` caused double negation because `createFootprint` expects positive overhang lengths and negates them internally. This caused the rear edge to flip forward and the right edge to flip to the positive y-coordinate (+0.948 m), collapsing the footprint polygon into a zero-width line segment with 0.0 m^2 area and preventing out-of-lane overlap detection from functioning. Fix this by: 1. Passing non-negative overhangs using `std::abs` for rear and right offsets to `VehicleInfo`. 2. Applying asymmetric `extra_left_offset` and `extra_right_offset` directly to `left_overhang_m` and `right_overhang_m` rather than distorting them through an averaged symmetric `lat_margin`. 3. Using `std::abs` on `right_offset` and `rear_offset` in `lanelets_selection.cpp` and `filter_predicted_objects.cpp`. 4. Adding unit regression tests in `test/test_footprint.cpp` validating footprint area, bounding box coordinates, offset handling, and lanelet polygon overlap detection. Signed-off-by: paneendrakumar0 <paneendra100@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In
autoware_motion_velocity_out_of_lane_module,out_of_lane_module.cppinitializes vehicle offsets fromvehicle_info_utils:In ISO 8855 / Autoware vehicle coordinates,
min_longitudinal_offset_m(e.g. -1.10 m) andmin_lateral_offset_m(e.g. -0.948 m) are signed negative values relative tobase_link.In
make_base_footprint, these signed values were directly assigned tovehicle_info.rear_overhang_mandvehicle_info.right_overhang_m:However,
VehicleInfo::createFootprintassumes positive overhang distances and negates them internally:x_rear = -(rear_overhang_m + rear_lon_margin)y_right_front = -(wheel_tread_m * 0.5 + right_overhang_m + margin)Because negative values were passed, a double negation occurred:
x_rearevaluated to-(-1.10) = +1.10 m(in front of the rear axle).y_rightevaluated to-(-0.948) = +0.948 m(the exact same coordinate asy_leftat+0.948 m).As a result, the generated polygon collapsed into a zero-width line segment with an area of
0.0 m^2:(3.79, 0.948), (3.79, 0.948), (1.10, 0.948), (1.10, 0.948), (3.79, 0.948).Consequently, polygon intersection and overlap detection with adjacent lanelets always evaluated to empty/disjoint in simulation and real vehicles, disabling collision avoidance checks in the module.
In addition:
lat_marginwas previously calculated as(right_offset + left_offset) / 2and passed symmetrically, distorting asymmetricextra_left_offsetandextra_right_offset.lanelets_selection.cppandfilter_predicted_objects.cpp,right_offsetandrear_offsetwere added directly to margins without accounting for their signed negative nature.Changes:
make_base_footprint:std::abs(p.rear_offset)andstd::abs(p.right_offset).extra_left_offsetandextra_right_offsetdirectly toleft_overhang_mandright_overhang_m.createFootprint(0.0, 0.0, 0.0, front_offset, rear_offset)ensuring exact dimensional inflation on each side.lanelets_selection.cpp:std::abs(params.right_offset)andstd::abs(params.rear_offset)when computingmax_ego_footprint_offset.filter_predicted_objects.cpp:std::abs(params.right_offset)when checkingis_crossing_ego.test/test_footprint.cppverifying non-zero footprint area, exact bounding box dimensions matchingVehicleInfo, asymmetric extra offset handling, and lanelet overlap detection.Related links
Parent Issue:
How was this PR tested?
Built package and ran unit tests with ROS 2 Jazzy:
Result: 5/5 tests passed (100% pass), including 4 new footprint and overlap tests:
TestFootprint.BaseFootprintDimensionsAndArea: PASSED (Calculated area: 9.27144 m^2 vs expected 9.27144 m^2; min/max x: [-1.10, 3.79], min/max y: [-0.948, 0.948])TestFootprint.BaseFootprintWithExtraOffsets: PASSED (Properly expanded min/max bounds and area 12.49524 m^2)TestFootprint.BaseFootprintIgnoreOffset: PASSED (Correct base dimensions returned)TestFootprint.CurrentEgoFootprintAndLaneletOverlap: PASSED (Successfully detects collision/overlap with adjacent lanelet)Verified
git diff --checkandgit clang-format --diffclean.Notes for reviewers
None.
Interface changes
None.
Effects on system behavior
Restores ego footprint generation in
autoware_motion_velocity_out_of_lane_modulefrom a collapsed 0-width line segment back to the true 2D vehicle bounding polygon, enabling correct overlap and collision detection with surrounding lanelets.