Skip to content

Fix Sync ZOH after Control off and Frenet SD orientation - #26

Draft
cursor[bot] wants to merge 2 commits into
devfrom
cursor/critical-bug-inspection-d684
Draft

Fix Sync ZOH after Control off and Frenet SD orientation#26
cursor[bot] wants to merge 2 commits into
devfrom
cursor/critical-bug-inspection-d684

Conversation

@cursor

@cursor cursor Bot commented Aug 2, 2026

Copy link
Copy Markdown

Summary

Two high-severity correctness bugs found in recent 0.5.3-era control/Frenet paths:

  1. SyncExecuter keeps actuating after Control is unchecked_simulate_step continued applying the held ZOH command when call_control=False, so the plant kept integrating the last accel/steer. Async already exits its control worker when Control is off; Sync did not.
  2. Frenet teleport/spawn orientation uses tracker current_wp, not path heading at sconvert_sd_orientation_to_xy_orientation added the heading of the currently tracked segment. Teleporting/spawning on a later segment (e.g. after a corner) pointed the ego/NPC the wrong way. The Frenet-view orient drag also passed the mouse-tip (s,d) instead of the click pose.

Root cause

  • 0.5.3 split control compute from plant integrate (ZOH). Simulate always applied _last_cmd whenever actuation was allowed, ignoring the Control stage gate.
  • Orientation conversion reused tracker waypoint indices instead of the same arc-length segment bracketing as convert_sd_to_xy.

Fix

  • Clear _last_cmd when call_control=False (paced ZOH with Control still enabled is unchanged).
  • Bracket path heading by s in convert_sd_orientation_to_xy_orientation.
  • Frenet orient drag converts at teleport_s/teleport_d.

Validation

  • test_call_control_false_drops_held_zoh_command — Control off → no further control_ego_state, _last_cmd cleared; existing paced-ZOH test still passes.
  • test_sd_orientation_uses_heading_at_s_not_tracker_wp — vertical-leg query with tracker at start → θ ≈ π/2; also covers final-wp current==next.
Open in Web View Automation 

cursoragent and others added 2 commits August 2, 2026 11:11
When call_control=False, clear the held command so simulate cannot keep
integrating the last accel/steer. Paced control with call_control=True still
holds between recomputes (intentional ZOH).

Co-authored-by: Majid Khonji <majid-khonji@users.noreply.github.com>
convert_sd_orientation_to_xy_orientation now brackets the path segment by
arc-length (same as convert_sd_to_xy). Frenet teleport also converts at the
click pose, not the drag-tip cursor.

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