Skip to main content

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.

ParameterTypeDescription
stateintTarget 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).

ValueStateDescription
0DefaultNo upper-body task
1UpperBodyActStateArm swing
2RemoteStateUpper-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.