stateDiagram-v2
    direction LR
    init: 初始化
    app_loaded: 内置APP模式(通过SDK load_app接口选择要加载的APP)
    ext_ctrl: 外部控制模式(通过SDK switch_mode切换控制模式)

    offline_connected: USB已连接,等待控制服务

    state ext_ctrl {
      direction LR
      planning_pos: 位置控制(规划)
      servo_pos_joint: 位置控制
(伺服,关节空间) servo_pos_cart: 位置控制
(伺服,笛卡尔空间) servo_vel_joint: 速度控制
(伺服,关节空间) servo_vel_cart: 速度控制
(伺服,笛卡尔空间) gravity_comp: 重力补偿 } [*] --> init: 上电 init --> offline_connected: USB连接 offline_connected --> ext_ctrl: 控制服务启动 ext_ctrl --> app_loaded: 底座按键 [长按] app_loaded --> ext_ctrl: SDK调用 [unload_app] app_loaded --> ext_ctrl: 底座按键 [长按] ext_ctrl --> app_loaded: SDK调用 [load_app] classDef cyan fill:#00FFFF,stroke:#007F7F,stroke-width:2px,color:#000; classDef blue fill:#7F7FFF,stroke:#3F3F7F,stroke-width:2px,color:#000; classDef red fill:#FF7F7F,stroke:#7F3F3F,stroke-width:2px,color:#000; classDef purple fill:#FF7FFF,stroke:#7F3F7F,stroke-width:2px,color:#000; classDef green fill:#7FFF7F,stroke:#3F7F3F,stroke-width:2px,color:#000; classDef yellow fill:#FFFF3F,stroke:#7F7F3F,stroke-width:2px,color:#000; classDef light_grey fill:#BBBBBB,stroke:#777777,stroke-width:2px,color:#000; class idle cyan class idle breathing class drag blue class recording blue class recording flowing class replay_waiting purple class replay_waiting flashing class replay_ready purple class replaying purple class replaying breathing class replay_paused purple class replay_paused flashing class planning_pos green class servo_pos_joint green class servo_pos_cart green class servo_vel_joint green class servo_vel_cart green class gravity_comp green class self_check yellow class calibration_needed yellow class calibration_needed flashing class offline_idle light_grey class offline_connected light_grey class offline_connected breathing class failure red