Skip to content

Add regression tests for lattice partial replan, track-end gate, and e-stop switch - #27

Draft
cursor[bot] wants to merge 1 commit into
devfrom
cursor/missing-test-coverage-e80f
Draft

Add regression tests for lattice partial replan, track-end gate, and e-stop switch#27
cursor[bot] wants to merge 1 commit into
devfrom
cursor/missing-test-coverage-e80f

Conversation

@cursor

@cursor cursor Bot commented Aug 3, 2026

Copy link
Copy Markdown

Summary

Adds focused regression coverage for GreedyLatticePlanner sliding-window and plan-switch paths that remained untested after recent closed-loop / lattice work. Complements (does not duplicate) open drafts #17/#20/#22/#23/#24/#25/#26.

Risky behavior now covered

  • _partial_replan obstacle_polygons glue: with agents, every check_collision call receives precomputed polygons; without agents the kwarg stays None (avoids silent CV-sweep slow-path semantics)
  • _partial_replan track_end_s gate: skips extension when tail.s + maneuver_distance > track_end_s; extends by one maneuver when room remains
  • _advance_local_plan handoff: traversed head with successor advances to next edge and calls _on_edge_traversed_partial_replan; no successor holds and does not call
  • should_switch_plan emergency-stop recovery: trailing velocity last < 0.5 and mean < 3.0 recovers to a clean plan; low-speed cruise and last >= 0.5 do not misclassify

Test files added/updated

  • test/c20_planning/test_c28_local_lattice_planners.py

Why these tests materially reduce regression risk

Sliding-window extension is the default local-plan grow path after each edge traverse. Dropping obstacle_polygons would change collision semantics vs predictor-gated precompute. Wrong track_end_s gating (or reverting to stale path_s[-2]) can append edges past finish or stop extending early. Emergency-stop recovery prevents stuck near-zero profiles without jittering normal low-speed cruise.

Validation

pytest test/c20_planning/test_c28_local_lattice_planners.py -v

All 40 tests passed. No production code changes.

Open in Web View Automation 

Cover obstacle_polygons hot-path glue in _partial_replan, track_end_s
extension gate, edge-traversal handoff, and trailing-velocity emergency
stop recovery in should_switch_plan.

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