Fsm state pub#169
Merged
Merged
Conversation
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>
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.
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.