How haozhang04/leggedskilldeploy works
LeggedSkillDeploy is a state-machine-based Python framework for deploying multiple learned robot policies in simulation or on a Go1 Pro. The principal workflow starts in a simulator or real-robot runner, accepts operator commands, evaluates policies through the deployment and policy layers, then sends robot commands through a simulation or hardware interface. The README documents MuJoCo, GLFW, Gazebo, and real Go1 operation, plus policies for several robot types and keyboard, Xbox, and phone controls. Some subsystems are represented from README or index evidence; their internal wiring is not inferred.
Main entry points: rl_sdk.py Policy runtime · rl_gazebo.py Gazebo runner · rl_deploy.py Policy deployment · keyboard_control.py Keyboard controls
Components 25
Runtime entrypoints
- MuJoCo runner
src/rl_mujoco.py - GLFW runner
src/rl_mujoco_glfw.py - Gazebo runner
src/rl_gazebo.py - Real robot runner
src/rl_real_go1.py - Robot descriptions
robot_description/urdf/src
Operator control
- Keyboard controls
src/input_dev/keyboard_control.py - Phone web controls
src/input_dev/phone_web_control.py - Xbox controls
src/input_dev/xbox_control.py - Xbox controls
src/input_dev/xbox_control_pygame.py
Policy execution
- Policy deployment
src/scripts/rl_deploy.py - Policy runtime
src/scripts/rl_sdk.py - Robot and control data
src/scripts/rl_data.py - Motion loader
src/scripts/motion_loader.py - Observation buffer
src/scripts/observation_buffer.py - Quaternion utilities
src/utils/math.py
Robot interfaces
- MuJoCo I/O
src/interface/IOMuJoCo.py - Gazebo I/O
src/interface/IOGazebo.py - Go1 hardware I/O
src/interface/IOReal_go1.py
Go1 protocol
- Unitree connection
motor_sdk/go1_pro_sdk/ucl/unitreeConnection.py - Low-level commands
motor_sdk/go1_pro_sdk/ucl/lowCmd.py - Low-level state
motor_sdk/go1_pro_sdk/ucl/lowState.py - Protocol data types
motor_sdk/go1_pro_sdk/ucl/complex.py - Protocol encoding
motor_sdk/go1_pro_sdk/ucl/common.py - Protocol enums
motor_sdk/go1_pro_sdk/ucl/enums.py
Other components
- Operator
Connections 48
- Operator → Keyboard controls: provides keys
README.md - Operator → Xbox controls: provides input
README.md - Operator → Phone web controls: provides input
README.md - MuJoCo runner → Policy deployment: creates deployment
src/rl_mujoco.py - GLFW runner → Policy deployment: creates deployment
src/rl_mujoco_glfw.py - Gazebo runner → Policy deployment: creates deployment
src/rl_gazebo.py - Real robot runner → Policy deployment: creates deployment
src/rl_real_go1.py - MuJoCo runner → MuJoCo I/O: creates interface
src/rl_mujoco.py - GLFW runner → MuJoCo I/O: creates interface
src/rl_mujoco_glfw.py - Gazebo runner → Gazebo I/O: creates interface
src/rl_gazebo.py - Real robot runner → Go1 hardware I/O: creates interface
src/rl_real_go1.py - MuJoCo runner → Keyboard controls: starts controls
src/rl_mujoco.py - MuJoCo runner → Phone web controls: starts controls
src/rl_mujoco.py - MuJoCo runner → Xbox controls: selects controls
src/rl_mujoco.py - GLFW runner → Keyboard controls: starts controls
src/rl_mujoco_glfw.py - GLFW runner → Phone web controls: starts controls
src/rl_mujoco_glfw.py - GLFW runner → Xbox controls: selects controls
src/rl_mujoco_glfw.py - Gazebo runner → Keyboard controls: starts controls
src/rl_gazebo.py - Gazebo runner → Phone web controls: starts controls
src/rl_gazebo.py - Gazebo runner → Xbox controls: starts controls
src/rl_gazebo.py - Real robot runner → Keyboard controls: starts controls
src/rl_real_go1.py - Real robot runner → Phone web controls: starts controls
src/rl_real_go1.py - Real robot runner → Xbox controls: starts controls
src/rl_real_go1.py - Keyboard controls → Policy runtime: updates control
src/input_dev/keyboard_control.py - Phone web controls → Robot and control data: uses control data
src/input_dev/phone_web_control.py - Xbox controls → Policy runtime: updates control
src/input_dev/xbox_control.py - Xbox controls → Policy runtime: updates control
src/input_dev/xbox_control_pygame.py - Policy deployment → Policy runtime: uses policy runtime
src/scripts/rl_deploy.py - Policy deployment → Robot and control data: uses control data
src/scripts/rl_deploy.py - Policy runtime → Robot and control data: uses data types
src/scripts/rl_sdk.py - Policy runtime → Motion loader: loads motion
src/scripts/rl_sdk.py - Policy runtime → Observation buffer: uses buffer
src/scripts/rl_sdk.py - Policy runtime → Quaternion utilities: uses quaternion math
src/scripts/rl_sdk.py - Go1 hardware I/O → Low-level commands: builds commands
src/interface/IOReal_go1.py - Go1 hardware I/O → Low-level state: reads state
src/interface/IOReal_go1.py - Go1 hardware I/O → Protocol data types: uses data types
src/interface/IOReal_go1.py - Go1 hardware I/O → Unitree connection: sends over connection
src/interface/IOReal_go1.py - Low-level commands → Protocol data types: uses data types
motor_sdk/go1_pro_sdk/ucl/lowCmd.py - Low-level commands → Protocol encoding: uses encoding
motor_sdk/go1_pro_sdk/ucl/lowCmd.py - Low-level commands → Protocol enums: uses modes
motor_sdk/go1_pro_sdk/ucl/lowCmd.py - Low-level state → Protocol data types: uses data types
motor_sdk/go1_pro_sdk/ucl/lowState.py - Low-level state → Protocol encoding: uses decoding
motor_sdk/go1_pro_sdk/ucl/lowState.py - Low-level state → Protocol enums: uses enums
motor_sdk/go1_pro_sdk/ucl/lowState.py - Protocol data types → Protocol encoding: uses conversions
motor_sdk/go1_pro_sdk/ucl/complex.py - Protocol data types → Protocol enums: uses modes
motor_sdk/go1_pro_sdk/ucl/complex.py - Unitree connection → Protocol encoding: uses protocol helpers
motor_sdk/go1_pro_sdk/ucl/unitreeConnection.py - Unitree connection → Low-level state: handles state
motor_sdk/go1_pro_sdk/ucl/unitreeConnection.py - Robot descriptions → Gazebo runner: supports simulation
README.md