Repository navigation
feat(bus): add Fleet and StopGuard for multi-bus group ops - #10
Draft
dougcalobrisi wants to merge 1 commit into
Draft
dougcalobrisi wants to merge 1 commit into
dougcalobrisi wants to merge 1 commit into
Conversation
Fleet runs safe_stop_all / set_mode_all on several physical buses concurrently (one scoped thread per bus), so an adapter-per-wheel machine stops in step in ~300 ms instead of bus after bus. StopGuard is the drop-to-stop guard every example and the rover app used to hand-roll. Adds the four_wheel_one_per_bus example (thread per bus, shared cancel flag), tests/fleet.rs, and docs for both. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ecch8hgo8KJfKHfKZ89Ng6
Owner
Author
|
Moving to draft: awaiting a run on real hardware. The timing claims (per-bus budget, in-step stop across buses) are pacing arithmetic until |
dougcalobrisi
marked this pull request as draft
August 23, 2026 18:25
This branch has not been deployed
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
Fleet— group operations across several physical buses.safe_stop_all/set_mode_allrun on every bus concurrently (one scoped thread per bus), so an adapter-per-wheel machine stops in step in nominally ~300 ms instead of bus after bus (~1.2 s, decelerating out of step). A bus whose thread can't spawn runs inline alongside the others; nothing is skipped.StopGuard— the crate now ships the drop-to-stop guard (m0601::StopGuard/fleet.stop_guard()). Replaces the three hand-rolled copies in the two examples andm0601-quad.four_wheel_one_per_busexample —four_wheel_minimalwith one adapter per wheel: thread per bus, per-bus budget assertion, shared cancel flag so one failed wheel brings the others out of their loops within a cycle.m0601/tests/fleet.rs(frame-for-frame parity with single-bus ops, validation before send, error aggregation, guard behaviour, concurrency bound). Docs and CHANGELOG updated.Timing figures are the crate's own pacing arithmetic; several USB-serial adapters on one host are unmeasured and the docs say so.
Test plan
cargo clippy --workspace --all-targets -- -D warningscleancargo test --workspace— 268 passed (incl. doctests)four_wheel_one_per_buswith four adapters (not available to me)🤖 Generated with Claude Code
https://claude.ai/code/session_01Ecch8hgo8KJfKHfKZ89Ng6