Skip to content

Fsm state pub#169

Merged
wdc3iii merged 3 commits into
mainfrom
fsm-state-pub
Jul 9, 2026
Merged

Fsm state pub#169
wdc3iii merged 3 commits into
mainfrom
fsm-state-pub

Conversation

@wdc3iii

@wdc3iii wdc3iii commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Publish the states of the FSM, UserPose and Damping no longer require messaged published on the low level control subscriber for the unitree g1 interface.

wdc3iii and others added 3 commits July 6, 2026 10:22
The interface only logged FSM transitions; the actual ExecFSMState was never
published, so downstream nodes could only see the *commanded* /exec_fsm (which
may be rejected). Register a pub_fsm_state publisher and broadcast the real
exec_fsm_state_ on activate (initial INIT), at the end of every successful
TransitionFSM, and on a 5 Hz heartbeat (guarded by is_activated()) so a node
that (re)starts mid-run can recover the current state without transient-local
QoS.

The low-level RL controller arms off this so the policy only runs once the
robot is really in LOW_LEVEL_CONTROL, eliminating the out-of-distribution
closed-loop window on the last-action observation between arming and the
hardware accepting control.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add PassiveHoldCallback (timer_ctrl, 50 Hz) that autonomously drives
WriteUserPoseCommand / WriteDampingCommand so those states don't depend
on controller messages arriving.  ApplyControl now guards on USER_CTRL
only and contains no USER_POSE branch.  TransitionToDamp calls the shared
WriteDampingCommand helper for the transition-instant write; the timer
sustains it afterward.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Damping and ESTOP are intentionally not command-debounced, so the joystick
republishes them every callback tick while held, flooding the console with
"sent Execution FSM Command" (joystick) and "ALREADY IN COMMANDED STATE" /
"ESTOP TRIGGERED" (hardware) lines.

Add a leading-edge FsmLogDebounce helper (unitree_fsm.h): logs on key change
(a fresh command prints immediately) or after the period elapses, suppressing
same-key repeats in between. Applied to the LOG LINES ONLY -- the publish,
transitions, and ESTOP throw are untouched. Period reuses the existing 0.5s
FSM command gate.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@wdc3iii wdc3iii merged commit 5eb38a3 into main Jul 9, 2026
@wdc3iii wdc3iii deleted the fsm-state-pub branch July 12, 2026 17:06
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