Skip to content

Add regression tests for lap S-crossover, lattice boundaries, and collision precompute glue - #25

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

Add regression tests for lap S-crossover, lattice boundaries, and collision precompute glue#25
cursor[bot] wants to merge 1 commit into
devfrom
cursor/missing-test-coverage-07ad

Conversation

@cursor

@cursor cursor Bot commented Aug 2, 2026

Copy link
Copy Markdown

Summary

Adds focused regression coverage for high-risk planning/tracker paths left thinly tested after recent closed-loop track_end_s / lattice work. Complements (does not duplicate) open drafts #17/#20/#22/#23/#24.

Risky behavior now covered

  • Race lap S-crossover (LocalPlanningStrategy.step): lap increments only when previous s is past 0.8 * track_end_s and new s is near start; does not treat the stale path_s[-2] band as near-end; mid-track and race_mode=False do not increment
  • Lattice._check_boundary_violation: left(+)/right(−) boundary convention with clearance inset; missing parent Frenet path returns False
  • generate_lattice_from_nodes hot-path glue: with agents, every check_collision call receives precomputed obstacle_polygons; without agents the kwarg stays None
  • convert_sd_orientation_to_xy_orientation: world yaw = Frenet theta + heading of the cursor current_wp→next_wp segment

Test files added/updated

  • test/c20_planning/test_c23_local_planning_pipeline.py
  • test/c20_planning/test_c28_local_lattice_planners.py
  • test/c50_common/test_c54_trajectory_waypoint_update.py

Why these tests materially reduce regression risk

Lap counting and lattice feasibility gate race sessions and overtaking. Silently reverting to path_s[-2], weakening boundary clearance, or dropping precomputed polygons would mis-count laps, accept off-road edges, or fall back to the slow collision path with different CV-sweep semantics. Orientation composition feeds spawn/teleport helpers that already depend on in-bounds next_wp.

Validation

pytest test/c20_planning/test_c23_local_planning_pipeline.py \
  test/c20_planning/test_c28_local_lattice_planners.py \
  test/c50_common/test_c54_trajectory_waypoint_update.py -v

All 59 tests passed. No production code changes.

Open in Web View Automation 

…lision precompute glue.

Cover race lap detection via track_end_s, Lattice._check_boundary_violation
clearance rules, generate_lattice_from_nodes obstacle_polygons plumbing, and
Frenet orientation composition on the cursor segment.

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