Fix corridor-only collision index delaying braking to path end - #30
Draft
cursor[bot] wants to merge 1 commit into
Draft
Fix corridor-only collision index delaying braking to path end#30cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
_find_collision_index now uses centerline distance within ego half-width plus safety margin, matching the buffered corridor check, so side obstacles trigger braking at the mid-path hit instead of n-1. Co-authored-by: Majid Khonji <majid-khonji@users.noreply.github.com>
This was referenced Aug 5, 2026
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.
Bug
check_collisiondetects side obstacles via a buffered ego corridor (half-width + safety margin), but_find_collision_indexsearched with a bare centerlineLineString.intersects. When only the buffer hits, the search fell back ton-1.Impact
An agent beside the path inside the corridor (common parked/lateral case) was reported as a collision at path end. Velocity profiling and lattice urgent-switch then treated the threat as ~track-length away, so the ego kept cruise speed through the real obstacle.
Trigger
Straight path, ego width 2 m, margin 0.3 m, static agent at
(30, 1.5)with width 2 m: corridor intersects, centerline does not → old idx30, fixed idx~8.Fix
Binary search now uses
partial_line.distance(obstacle) <= radius, matching corridor detection. Minimal change; no planner API churn.Validation
pytest test/c50_common/test_c55_collision_checking.py test/c20_planning/test_c27_local_behavioral_and_velocity_planners.py— 23 passed