FSM Control
set_fsm_state()
Python
set_fsm_state(state: int) -> bool
Switches the whole-body FSM state. Returns True on success, False on timeout or rejection.
| Parameter | Type | Description |
|---|---|---|
state | int | Target state DDS mapping value — see State Overview |
UserController_* to algorithm mapping is defined in user_runner_config.yaml on the robot.
Example
Python
client.set_fsm_state(2) # switch to PdStand
time.sleep(1.0) # wait for new task to load and stabilize
get_fsm_state()
Python
get_fsm_state() -> int
Returns the current whole-body FSM state DDS mapping value.
get_fsm_name()
Python
get_fsm_name() -> str
Returns the current whole-body FSM state name string, e.g. "PdStand".
Example
Python
print(client.get_fsm_state()) # 2
print(client.get_fsm_name()) # "PdStand"
set_upper_fsm_state()
Python
set_upper_fsm_state(state: int) -> bool
Switches the upper-body FSM state. Returns True on success, False on timeout or rejection. Only effective when the whole-body state supports upper-body management (e.g. RL Locomotion).
| Value | State | Description |
|---|---|---|
| 0 | Default | No upper-body task |
| 1 | UpperBodyActState | Arm swing |
| 2 | RemoteState | Upper-body teleoperation (joint control) |
Example
Python
client.set_fsm_state(3) # switch to RL Locomotion
time.sleep(1.0)
client.set_upper_fsm_state(1) # enable arm swing
get_upper_fsm_state()
Python
get_upper_fsm_state() -> int
Returns the current upper-body FSM state DDS mapping value.
get_upper_fsm_name()
Python
get_upper_fsm_name() -> str
Returns the current upper-body FSM state name string.