legion1581/unitree_webrtc_connect

Unitree Go2 / G1 / R1 WebRTC driver

What it solves

This project provides a Python-based WebRTC driver that allows users to control Unitree robots (Go2, G1, and R1) without needing to jailbreak the robot or modify its firmware. It replicates the communication protocol used by the official mobile apps, enabling high-level control and data retrieval over a local network or remotely via the cloud.

How it works

The driver implements the Unitree WebRTC protocol to establish a connection via three different methods: Local Access Point (AP), Local Station (STA-L), or Remote (STA-T) via Unitree's TURN servers. For newer firmware versions that require per-device AES-128-GCM authentication, the project includes a CLI tool and programmatic helpers to fetch the necessary decryption keys from the Unitree cloud.

Who it’s for

Developers and researchers working with Unitree Go2, G1, and R1 robots who want to programmatically control their hardware, stream video/audio, or access sensor data (like LiDAR) using Python.

Highlights

  • Broad Model Support: Compatible with Go2, G1, and R1 robot models across various firmware versions.
  • Multi-modal Data Access: Supports receiving video streams, receiving/sending audio (Go2), and decoding LiDAR point clouds (Go2).
  • Robot Control: Enables sport mode movement commands, FSM state control for humanoids, and upper-limb gesture control for the R1.
  • Flexible Connectivity: Supports local WiFi connections and remote cloud-based control using Unitree account credentials.
  • Built-in Auth Tooling: Includes a dedicated utility to retrieve per-device AES keys for secure handshakes on modern firmware.

Related

  • Project
  • Project
  • Project
  • Project
  • Project