Repository navigation
Cwbollinger/state machine declarative clean - #142
Open
cwbollinger wants to merge 10 commits into
Open
cwbollinger wants to merge 10 commits into
cwbollinger wants to merge 10 commits into
Conversation
cwbollinger
force-pushed
the
cwbollinger/state-machine-declarative-clean
branch
from
November 19, 2026 06:21
74e1104 to
c7a2b02
Compare
…ded TreadedBase Move these demos to the GroupManager-based TreadedBase API (from_config, no t_now, on_base_update) introduced for the tready demos. Not yet tested on hardware.
…ward.py Add treadward.cfg.yaml and have the Treadward selector launch treaded_base with it. That replaces treadward.py, which imports TreadedBaseControl, MobileIOModes and try_create_base_group (none of which exist any more) and which nothing else launches, so remove it. Not yet tested on hardware.
… invalid pose Not yet tested on hardware.
kits/common/state_machine.py: a Controller that runs on a GroupManager thread, with ControllerState classes. update() returns the next state; receive_inputs() only records requests, so only the Controller ever transitions. Input loss enters DisconnectedState, which holds position; an M-stop enters a fault state that drops the goal and resumes afterwards. kits/common/config.py: shared config loading and command-line helpers. Removes the old state_machine_template.py, which this replaces.
Add kits/arms/arm_controller.py (ArmController: gripper handling, hold on disconnect, fault state) and rewrite the AR, joystick and leader/follower controllers as states on it. The other kits/arms examples and the Rosie arm demo load their settings from config files and use the shared helpers. All arm demos use the same LED colors: magenta while homing, blue when disconnected, transparent otherwise, set by ArmController from the state. An invalid AR phone orientation is NaN, so the arm holds position instead of tracking an identity pose. The tready arm demos still use the old classes until "Tready demos: use the demo runner".
The mast and camera run as GroupManagers under a MastController with startup, teleop, disconnected, fault and exit states. Disconnect holds position, and an M-stop drops the goal and returns to teleop once released. Mast settings move to config/pan_tilt_mast.cfg.yaml. tready_mast_demo still uses the old classes until "Tready demos: use the demo runner".
cwbollinger
force-pushed
the
cwbollinger/state-machine-declarative-clean
branch
from
November 19, 2026 06:30
c7a2b02 to
012fd3c
Compare
TreadedBase states return the next state from update(), with the controller and Mobile IO updater built on kits/common/state_machine. The Mobile IO updater queues its changes for the main thread (one layout/label/status flush per poll) instead of talking to the phone from the control thread, and the demo_runner module holds the loop every tready demo shares (find hardware, start controllers, poll the phone, hand each controller its input or explicit idle inputs, log, shut down). The tready demos still use the old API until "Tready demos: use the demo runner".
The base, arm (AR and joystick), camera mast, sampler, leader/follower and sub demos take their config files on the command line and run through demo_runner. Add the configs for the sub, MAPS follower and core sampler demos; the demo and Treadward selectors launch them with their configs. The joystick arm parser treats NaN axes (read right after a layout is sent) as no input. Remove demo_selector.py: the web-based demo selector replaces it.
Show "Low Battery" below 32 V and "CHARGE NOW!" below 31 V in the Mobile IO status text, instead of only the voltage. A voltage of 0 (no reading yet) is not a low battery.
…chine Drive TreadedBaseController, MastController and the arm controllers against imitated modules (disconnect holds, M-stop recovery, resume to the interrupted state, NaN IMU or phone pose), unit-test the common state machine, and check the Mobile IO parsers, LED colors, low-battery text and demo config targets. Static checks: only the Controller transitions states, the demos parse on Python 3.11, and log names and selector targets are valid. Free test Groups promptly so a later test does not block on them.
cwbollinger
force-pushed
the
cwbollinger/state-machine-declarative-clean
branch
from
November 19, 2026 06:45
012fd3c to
4a59579
Compare
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.
No description provided.