Skip to main content

Full Unitree Go2 WebRTC Driver

This repository contains a Python implementation of the WebRTC driver to connect to the Unitree Go2 Robot.

  • High level control of the dog through WebRTC (like the Unitree Go app)
  • No jailbreak or firmware manipulation required.
  • Compatible with Go2 AIR/PRO/EDU models.

Description of the image

Installation

pip install go2-webrtc-connect

For audio and video:

pip install "go2-webrtc-connect[audio,video]"

Supported Firmware Versions

The currently supported Go2 firmware packages are:

  • 1.1.1 - 1.1.4 (latest available)
  • 1.0.19 - 1.0.25

Use the Unitree Go2 app to check your firmware version.

Audio Support

There is an audio (sendrecv) channel in WebRTC that you can connect to.

This is supported only on Go2 Pro and Edu. Check out the examples in the /examples/audio folder.

  1. Install portaudio19-dev.
# On Linux
sudo apt update && sudo apt install portaudio19-dev
# On MacOS
brew update && brew install portaudio19-dev
  1. Use the audio optional dependencies
uv run --extra audio  examples/audio/mp3_player/play_mp3.py

Video Support

There is video (recvonly) channel in WebRTC. Use the video optional dependencies for this.

uv run --extra audio  examples/audio/mp3_player/play_mp3.py

Lidar support

There is a lidar decoder built in, so you can handle decoded PoinClouds directly. Check out the examples in the /examples/data_channel/lidar folder.

Connection Methods

The driver supports three types of connection methods:

  1. AP Mode: Go2 is in AP mode, and the WebRTC client is connected directly to it:

    Go2WebRTCConnection(WebRTCConnectionMethod.LocalAP)
    
  2. STA-L Mode: Go2 and the WebRTC client are on the same local network. An IP or Serial number is required:

    Go2WebRTCConnection(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:

    Go2WebRTCConnection(WebRTCConnectionMethod.LocalSTA, serialNumber="B42D2000XXXXXXXX")
    
  3. STA-T mode: Remote connection through remote Unitrees TURN server. Could control your Go2 even being on the diffrent network. Requires username and pass from Unitree account

    Go2WebRTCConnection(WebRTCConnectionMethod.Remote, serialNumber="B42D2000XXXXXXXX", username="email@gmail.com", password="pass")
    

Multicast scanner

The driver has a built-in Multicast scanner to find the Unitree Go2 on the local network and connect using only the serial number.

Usage

Example programs are located in the /examples 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 and MrRobotow for providing a plot LiDAR example.

Support

This project is originally a fork from the repo of legion1581. Please consider buying the author a coffee:

Buy Me A Coffee

Metadata

Release files for go2-webrtc-connect 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for go2-webrtc-connect 0.2.1
File Size Uploaded
go2_webrtc_connect-0.2.1.tar.gz 31.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for go2-webrtc-connect 0.2.1
File Interpreter ABI Platform
go2_webrtc_connect-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 70.2 kB

Release files / go2_webrtc_connect-0.2.1.tar.gz

Download URL go2_webrtc_connect-0.2.1.tar.gz
Size 31.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9fddf74f6e75963af0d0ecf86dfa10fce8d2a11a3f7a46f0f28e686e35b0e058
BLAKE2b-256 checksum
How to use checksums
9e8d482ed17c425360ce755554132220b60d2ff185d2eb84b276d9de45bcea62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.8.13

Release files / go2_webrtc_connect-0.2.1-py3-none-any.whl

Download URL go2_webrtc_connect-0.2.1-py3-none-any.whl
Size 38.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
520f13cee82cd6a74c7de4ec4c3513deab658eff1c92cf03fdf6d28cd8dd03c6
BLAKE2b-256 checksum
How to use checksums
f7164f59c951a9d1616e684950067ed874f8ed65d6f0dd3d2dda9ac58a928551
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.8.13

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page