Skip to content

Fix pipeline velocity corrupting global speeds and mid-track path origin - #34

Draft
cursor[bot] wants to merge 1 commit into
devfrom
cursor/critical-bug-inspection-99e9
Draft

Fix pipeline velocity corrupting global speeds and mid-track path origin#34
cursor[bot] wants to merge 1 commit into
devfrom
cursor/critical-bug-inspection-99e9

Conversation

@cursor

@cursor cursor Bot commented Aug 6, 2026

Copy link
Copy Markdown

Bug and impact

  1. Global reference speeds permanently zeroed — With LocalPlanningPipeline + VelocityLocalPlanner and an empty path stage, plan_velocity profiled the shared global TrajectoryTracker in place. After braking for an obstacle, clearing the obstacle left the global velocities at 0, so the ego never resumed cruise.

  2. Mid-track local path started at the originReferencePathPlanner.plan_path copied the full route from s=0 with trajectory=None, so the velocity stage / controllers rebuilt a tracker at current_wp=0 while ego was mid-route (e.g. after a corner). Local plans aimed at the wrong segment and emergency-braked.

Root cause

  • LocalPlan.from_trajectory aliases the live global tracker; velocity profiling mutates it. ReferencePathPlanner avoided that alias but still emitted geometry from route start.
  • Standalone VelocityLocalPlanner.replan already cloned via slice_trajectory_horizon; the pipeline velocity stage did not.

Fix

  • VelocityLocalPlanner.plan_velocity profiles a copy (path/velocity/waypoints/boundaries).
  • ReferencePathPlanner.plan_path emits the forward horizon from current_wp (slice_trajectory_horizon(..., max_points=0)).

Validation

PYTHONPATH=/workspace python3 -m pytest \
  test/c20_planning/test_c23_local_planning_pipeline.py \
  test/c20_planning/test_c27_local_behavioral_and_velocity_planners.py -v

31 passed (includes new regressions for global-speed preservation and mid-track reference path).

Not re-reported (still open)

Open in Web View Automation 

…th origin.

VelocityLocalPlanner.plan_velocity now profiles a copy so LocalPlanningPipeline
cannot permanently zero the shared global reference. ReferencePathPlanner emits
the forward horizon from current_wp instead of the full route from s=0.

Co-authored-by: Majid Khonji <majid-khonji@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant