Skip to main content

FSM Control

set_fsm_state()​

Python
set_fsm_state(state: int) -> bool

Switches the whole-body FSM state. A True return only means Aurora has accepted the request; it does not mean the target task has started. Returns False on timeout or invalid parameters.

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
import os
import time

os.environ.setdefault("FASTDDS_BUILTIN_TRANSPORTS", "UDPv4") # required on the robot

from fourier_aurora_client import AuroraClient

client = AuroraClient.get_instance(domain_id=123, robot_name="grw")
try:
time.sleep(1.0)
target_state = 3
if not client.set_fsm_state(target_state):
raise RuntimeError("state change request not accepted by Aurora")

deadline = time.monotonic() + 4.0
while client.get_fsm_state() != target_state:
if time.monotonic() >= deadline:
raise RuntimeError("state did not switch to UserController_A in time")
time.sleep(0.05)
print(f"current state: {client.get_fsm_state()} ({client.get_fsm_name()})")
finally:
client.close()

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. "UserController_A".

Example

Python
import os
import time

os.environ.setdefault("FASTDDS_BUILTIN_TRANSPORTS", "UDPv4") # required on the robot

from fourier_aurora_client import AuroraClient

client = AuroraClient.get_instance(domain_id=123, robot_name="grw")
try:
time.sleep(1.0) # wait for state data
print(client.get_fsm_state()) # 3
print(client.get_fsm_name()) # "UserController_A"
finally:
client.close()

set_upper_fsm_state()​

Python
set_upper_fsm_state(state: int) -> bool

Switches the upper-body FSM state. The current GR-W mapping does not use a separate upper-body FSM; select grw_policy_task or upper_body_tele_task with whole-body states 3 and 4.

GR-W note

Do not call this API for GR-W. Requesting the current upper-body default value 0 while in whole-body state 3 returns False and the upper-body state stays Default. Upper-body teleoperation maps directly to whole-body state 4; do not use this API as its replacement.


get_upper_fsm_state()​

Python
get_upper_fsm_state() -> int

Returns the upper-body FSM state DDS mapping value. The current GR-W workflow does not use it.


get_upper_fsm_name()​

Python
get_upper_fsm_name() -> str

Returns the upper-body FSM state name. The current GR-W workflow does not use it.