How unitreerobotics/unitree_sdk2_python works
unitree_sdk2py is a Python SDK for communicating with and controlling Unitree robots. The principal workflow is an application calling a robot-specific client, which encodes a service request and sends it through the RPC/DDS communication layer to the robot; responses return through that layer. The SDK also documents topic-based publishing/subscription and high-/low-level status and control, alongside sport, locomotion, camera, audio, obstacle-avoidance, and VUI services. The graph preserves these capabilities, but several links to unsampled modules are dashed because their wiring is not shown in the excerpts.
Main entry points: client.py RPC client · channel.py Topic communication · client_base.py Request handling · sport_client.py Sport control
Components 24
Robot APIs
- Sport control
unitree_sdk2py/go2/sport/sport_client.py - Other sport clients
unitree_sdk2py/a2/sport - Humanoid locomotion
unitree_sdk2py/g1/loco/g1_loco_client.py - H2 locomotion
unitree_sdk2py/h2/loco/h2_loco_client.py - Robot status
unitree_sdk2py/go2/robot_state - Low-level control
unitree_sdk2py/idl/unitree_go/msg/dds_/_LowCmd_.py - Controller status
unitree_sdk2py/idl/unitree_go/msg/dds_/_WirelessController_.py - Obstacle avoidance
unitree_sdk2py/go2/obstacles_avoid - Camera video
unitree_sdk2py/go2/video - Audio services
unitree_sdk2py/a2/audio - Light and volume
unitree_sdk2py/go2/vui - Arm actions
unitree_sdk2py/g1/arm - Motion switching
unitree_sdk2py/comm/motion_switcher
RPC Transport
- RPC client
unitree_sdk2py/rpc/client.py - Request handling
unitree_sdk2py/rpc/client_base.py - DDS client stub
unitree_sdk2py/rpc/client_stub.py - DDS channels
unitree_sdk2py/core/channel.py - Lease control
unitree_sdk2py/rpc/lease_client.py - RPC server
unitree_sdk2py/rpc/server.py
DDS Messages
- RPC message types
unitree_sdk2py/idl/unitree_api/msg/dds_/_Request_.py - Robot data types
unitree_sdk2py/idl/unitree_go
Robot Services
- Topic communication
unitree_sdk2py/core/channel.py
Other components
- SDK user
- Unitree robot
Connections 26
- SDK user → Sport control: calls
- SDK user → Humanoid locomotion: calls
- Sport control → RPC client: calls
unitree_sdk2py/go2/sport/sport_client.py - Other sport clients → RPC client: calls
unitree_sdk2py/a2/sport/sport_client.py - Humanoid locomotion → RPC client: calls
unitree_sdk2py/g1/loco/g1_loco_client.py - H2 locomotion → RPC client: calls
unitree_sdk2py/h2/loco/h2_loco_client.py - Robot status → RPC client: uses
unitree_sdk2py/go2/robot_state/robot_state_client.py - Obstacle avoidance → RPC client: uses
unitree_sdk2py/go2/obstacles_avoid/obstacles_avoid_client.py - Camera video → RPC client: uses
unitree_sdk2py/go2/video/video_client.py - Audio services → RPC client: uses
unitree_sdk2py/a2/audio/audio_client.py - Light and volume → RPC client: uses
unitree_sdk2py/go2/vui/vui_client.py - Arm actions → RPC client: uses
unitree_sdk2py/g1/arm/g1_arm_action_client.py - Motion switching → RPC client: uses
unitree_sdk2py/comm/motion_switcher/motion_switcher_client.py - RPC client → Request handling: delegates
unitree_sdk2py/rpc/client.py - RPC client → Lease control: uses
unitree_sdk2py/rpc/client.py - Request handling → DDS client stub: sends requests
unitree_sdk2py/rpc/client_base.py - Request handling → RPC message types: builds requests
unitree_sdk2py/rpc/client_base.py - DDS client stub → DDS channels: uses
unitree_sdk2py/rpc/client_stub.py - RPC server → RPC message types: handles messages
unitree_sdk2py/rpc/server.py - RPC client → Unitree robot: RPC requests
- Unitree robot → RPC client: RPC responses
- SDK user → Topic communication: publishes or subscribes
- Topic communication → Unitree robot: DDS topics
- Low-level control → Topic communication: topic control
- Controller status → Topic communication: topic status
- Unitree robot → Robot data types: robot data