Fix closed-track false goal stop, planner wp clamp, and short velocity crash - #32
Draft
cursor[bot] wants to merge 1 commit into
Draft
Fix closed-track false goal stop, planner wp clamp, and short velocity crash#32cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
…y crash. GoalArrivalMonitor seeded its rising edge after the first in-radius sample, so Yas-style closed lines (goal==start) fired GOAL_ARRIVED/StopExecAtGoal immediately. LocalPlanningStrategy.reset now clamps wp (Plan step-back from 0 no longer jumps to track end). Controllers clamp velocity index when ReferenceSpeed is short. Co-authored-by: Majid Khonji <majid-khonji@users.noreply.github.com>
This was referenced Aug 6, 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 and impact
Closed-track false
GOAL_ARRIVED/ immediate stop — WithGoalArrivalMonitor+StopExecAtGoalTask, the rising-edge detector started as "not arrived". On closed race lines (goal_point == start_point), default Yas Marina start pose is ~2.1 m from the goal (inside the 3 m radius), so the first tick firedGOAL_ARRIVEDand stopped execution before any driving.Plan waypoint step-back / OOB — Plan UI step-back from wp 0 passed
wp=-1intoLocalPlanningStrategy.reset. Numpy negative indexing jumped localization to track end (~5251 m on Yas). Oversized wp values couldIndexErrorin the Tk UI.Control crash on short/empty velocity profile — Stanley / PID / Pure Pursuit indexed
velocity[current_wp]with no length guard. A plan whoseReferenceSpeedis shorter than the path crashed mid-drive oncecurrent_wppassed the short array.Root cause
reset(wp)did not clamp; UI allowed negative wp.len(velocity) == len(path).Fix
GoalArrivalMonitoron the first tick (and afterreset) without notifying; real arrivals still fire on leave → re-enter.LocalPlanningStrategy.reset(wp)to[0, n-1]; Plan UI step-back floors at 0.Validation
pytestfor goal-monitor seeding, planner reset clamp, and short/empty velocity profiles — 20 related tests passed.s≈track_end, post-fix stays ats≈0.