Unitree Go2 and G1 WebRTC Driver
This repository contains a Python implementation of the WebRTC driver to connect to the Unitree Go2 and G1 Robots. WebRTC is used by the Unitree Go/Unitree Explore APP and provides high-level control through it. Therefore, no jailbreak or firmware manipulation is required. It works out of the box for Go2 AIR/PRO/EDU models and G1 AIR/EDU.
Currently Supported Firmware Versions
Go2:
- 1.1.x series: 1.1.1 – 1.1.11 (latest available)
- 1.0.x series: 1.0.19 – 1.0.25
G1:
- 1.4.0 (latest available)
Audio and Video Support (Go2 only)
There are video (recvonly) and audio (sendrecv) channels in WebRTC that you can connect to. Check out the examples in the /example folder.
Lidar support (Go2 only)
There is a lidar decoder built in, so you can handle decoded PoinClouds directly. Check out the examples in the /example folder.
Connection Methods
The driver supports three types of connection methods:
-
AP Mode: Go2/G1 is in AP mode, and the WebRTC client is connected directly to it:
UnitreeWebRTCConnection(WebRTCConnectionMethod.LocalAP)
-
STA-L Mode: Go2/G1 and the WebRTC client are on the same local network. An IP or Serial number is required:
UnitreeWebRTCConnection(WebRTCConnectionMethod.LocalSTA, ip="192.168.8.181")
If the IP is unknown, you can specify only the serial number, and the driver will try to find the IP using the special Multicast discovery feature available on Go2:
UnitreeWebRTCConnection(WebRTCConnectionMethod.LocalSTA, serialNumber="B42D2000XXXXXXXX")
-
STA-T mode: Remote connection through remote Unitrees TURN server. Could control your Go2/G1 even being on the diffrent network. Requires username and pass from Unitree account
UnitreeWebRTCConnection(WebRTCConnectionMethod.Remote, serialNumber="B42D2000XXXXXXXX", username="email@gmail.com", password="pass")
Multicast scanner (Go2 only)
The driver has a built-in Multicast scanner to find the Unitree Go2 on the local network and connect using only the serial number.
PIP installation (Recommended)
cd ~
sudo apt update
sudo apt install -y python3-pip portaudio19-dev
pip install unitree_webrtc_connect
Manual Installation
cd ~
sudo apt update
sudo apt install -y python3-pip portaudio19-dev
pip install --upgrade setuptools pip
git clone https://github.com/legion1581/unitree_webrtc_connect.git
cd unitree_webrtc_connect
pip install -e .
Usage
Example programs are located in the /example directory.
Thanks
A big thank you to TheRoboVerse community! Visit us at TheRoboVerse for more information and support.
Special thanks to the tfoldi WebRTC project and abizovnuralem for adding LiDAR support, MrRobotow for providing a plot LiDAR example. Special thanks to Nico for the aiortc monkey patch.
Support
If you like this project, please consider buying me a coffee:
Metadata
Release files for unitree-webrtc-connect-leshy 2.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| unitree_webrtc_connect_leshy-2.0.7.tar.gz | 34.4 kB | Without provenance | Details for unitree_webrtc_connect_leshy-2.0.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| unitree_webrtc_connect_leshy-2.0.7-py3-none-any.whl | Python 3 | none | any | Details for unitree_webrtc_connect_leshy-2.0.7-py3-none-any.whl |
Total release size: 74.4 kB
Release files / unitree_webrtc_connect_leshy-2.0.7.tar.gz
| Download URL | unitree_webrtc_connect_leshy-2.0.7.tar.gz |
|---|---|
| Size | 34.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9eeddab68e42e286cd9ba1e520303a56fd0920dce2bd4ef0cdec1d21669fda3b
|
|
BLAKE2b-256 checksum How to use checksums |
d820a92ceb094188fcf176da5609878c923273d414e93b8b5bbbb32c4f6ffd7c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.11
|
Release files / unitree_webrtc_connect_leshy-2.0.7-py3-none-any.whl
| Download URL | unitree_webrtc_connect_leshy-2.0.7-py3-none-any.whl |
|---|---|
| Size | 40.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
82e2b9d842bf58288ec40e0bfd685780e20af9a2d0495aa9330950afde1d8ce4
|
|
BLAKE2b-256 checksum How to use checksums |
611be34448851e1cdad620175e048f58c177ac853564d4d7fdb9aa9cfc21eae7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.11
|
Security for unitree-webrtc-connect-leshy 2.0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.