Fix async Control/Plan toggle orphans and before-start waypoint index - #28
Draft
cursor[bot] wants to merge 1 commit into
Draft
Fix async Control/Plan toggle orphans and before-start waypoint index#28cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
… index. AsyncThreadedExecuter treated Control/Plan checkbox off as a dead worker, cleared the join list without stopping peers, then vacuous all([]) duplicated Planner threads. Prune finished workers and restart only enabled stages. update_waypoint_by_xy now resets to wp 0 when ego is upstream of path start so Stanley/PP do not keep a far-path heading after teleport/reset. Co-authored-by: Majid Khonji <majid-khonji@users.noreply.github.com>
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.
Summary
Two high-severity correctness bugs found in recent async / trajectory paths:
AsyncThreadedExecuterwas running treated the cooperative worker exit as a crash.step()clearedself.threadswithout stopping live peers, then vacuousall([])restarted workers and left multiple Planner threads (Control could not come back cleanly).update_waypoint_by_xyleft a stalecurrent_wpbefore path start — After driving far along a path and teleporting/resetting slightly upstream of the first waypoint (closest_wp==0, projecteds < path_s[0]), neither update branch ran. Stanley used the far-path heading (often π/2 after an L-corner) → max steer; Pure Pursuit used the wrong target speed.Root cause
is_alive()(call_control != alive), so intentional disable while the worker was still draining looked like a death; recreate wiped the join list withoutstop().shad no waypoint-update branch when the nearest index was already 0.Fix
_ensure_enabled_workersto start only stages that are enabled again (no peer teardown).create_threadskeeps still-alive peers in the join list.update_waypoint_by_xyresets tocurrent_wp=0/next_wp=1when ego is before path start.Validation
11 passed.
Not re-reported (still open)