Skip to content
⚙ Development Guide > SDK > Concept Guide

Robot Arm State and Indicator Effects#

ServiceState.fsm_state represents the current high-level operating state of P7. It determines what type of command the service can accept; the control lease determines which client can send ordinary control commands. The robot arm processes a corresponding motion request only when both conditions are satisfied.

State Groups#

State Meaning Recommended Action
IDLE Does not process ordinary motion targets Acquire control authority and switch to the required mode
PLANNING_CONTROL Accepts planned motion Send a single-target or waypoint plan; when busy, first confirm whether the previous task has ended
SERVO_CONTROL Accepts joint or Cartesian Servo targets Maintain stable sending; actively switch back to IDLE when finished
GRAVITY_COMPENSATION Gravity compensation is active Support the robot arm while teaching; switch back to IDLE afterward
FORCE_CONTROL Accepts MIT joint commands exposed by the SDK Use only parameters validated for the current complete system and payload
POSITION_CONTROL Direct-position-control state retained by the wire protocol No corresponding current SDK enum; switch back to a publicly supported mode
EMERGENCY_STOPPED A software emergency-stop request has entered the state machine Eliminate the hazard, reset according to the on-site procedure, and confirm IDLE
IN_COLLISION Collision monitoring triggered protection Keep stopped, record the scene and state, and follow the delivered recovery workflow
UNKNOWN_ERROR Communication, motor, or other hardware state triggered protection Identify and eliminate the cause before using the supported error-clearing workflow
UNKNOWN The SDK cannot map the received state value Do not send motion; record versions and logs and check compatibility

PLANNING_CONTROL does not distinguish between waiting for a request and executing a trajectory. Likewise, IDLE does not mean that no other client holds control authority or that the physical emergency stop has been reset.

Read-Only Check#

state = client.get_service_state()
if state is None:
    raise RuntimeError("服务状态缓存尚未建立")
if not state.valid or not state.service_state:
    raise RuntimeError("服务状态不可用或已经过期")

print("FSM:", state.fsm_state)
print("controller:", state.controller_state)

Reading state does not acquire control authority or trigger motion. On the DDS backend, valid can briefly be False between adjacent polls on a healthy connection. For ongoing diagnostics, evaluate it together with service_state and subsequent samples.

Protection States#

Software emergency stop, collision, and UNKNOWN_ERROR require different recovery workflows. An ordinary stop, releasing the lease, or closing the client cannot replace protection-state recovery; a software emergency stop also cannot replace the physical emergency stop. See Motor Error Code Troubleshooting for details.

Status Indicator Reference#

The P7 status indicator is located at the end of the robot arm. Its color and animation can help identify an operating phase quickly, but they cannot replace ServiceState, motor state, and on-site safety checks.

Operating State Indicator Effect
Brakes engaged; robot_app not started Steady white
Brakes engaged; robot_app starting Breathing yellow
Brakes engaged; control service in IDLE Steady yellow
Brakes released; in SERVO_CONTROL Steady green
Teaching replay ready, returning to the initial point, or replaying Breathing green, steady green, or flowing green
In GRAVITY_COMPENSATION Steady cyan
Recording in gravity-compensation mode Flowing cyan
In POSITION_CONTROL Steady gray-green
In FORCE_CONTROL Steady purple
In UNKNOWN_ERROR Steady pink

For product usage instructions for the indicator, see Robot Arm Status Indicator. For programmable state fields, see ServiceState (Server State).