
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
This repository contains a Python implementation of the WebRTC driver to connect to the Unitree Go2 Robot.
pip install go2-webrtc-connect
For audio and video:
pip install "go2-webrtc-connect[audio,video]"
The currently supported Go2 firmware packages are:
Use the Unitree Go2 app to check your firmware version.
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.
portaudio19-dev
.# On Linux
sudo apt update && sudo apt install portaudio19-dev
# On MacOS
brew update && brew install portaudio19-dev
audio
optional dependenciesuv run --extra audio examples/audio/mp3_player/play_mp3.py
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
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.
The driver supports three types of connection methods:
AP Mode: Go2 is in AP mode, and the WebRTC client is connected directly to it:
Go2WebRTCConnection(WebRTCConnectionMethod.LocalAP)
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")
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")
The driver has a built-in Multicast scanner to find the Unitree Go2 on the local network and connect using only the serial number.
Example programs are located in the /examples directory.
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.
This project is originally a fork from the repo of legion1581. Please consider buying the author a coffee:
FAQs
Connect to the Unitree Go2 with WebRTC
We found that go2-webrtc-connect demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.