This is Howest AI Lab's own custom SDK to control a Unitree Go2 robot dog. We noticed that many Python implementations of the WebRTC connection were deprecated or simply didn't work - at least on our robot. As it turns out, there is one stable JavaScript implementation by tfoldi. This repository offers the battle-tested stability of JavaScript's WebRTC APIs and developer-friendliness of Python.
You will need to have Python 3.10+ installed. You can download it from python.org.
You will also need to have Node.js installed. You can download it from nodejs.org.
Set up the Python environment:
python -m venv .venv
source .venv/bin/activate # <-- Linux/MacOS
.venv\Scripts\activate # <-- Windows-
Install the required Python dependencies
pip install -r requirements.txt
-
Install the required Node.js dependencies
cd server/socket npm install -
Run the signalling server
cd server/signalling python main.py -
Run the socket server
cd server/signalling node server.js -
You can now run the example script
cd client python main.py -
Or just use the SDK as shown below:
import time from models import RobotMessage from robot import Robot def callback(msg: RobotMessage): print(f"Lidar data: {msg.data}") robot = Robot("192.168.1.10") time.sleep(5) robot.enable_monitor_lidar_data(callback) time.sleep(5) robot.move(x=1, y=0, z=0) time.sleep(5) robot.close()
Coming soon.
- Dockerize the server code
- Implement data fetching with response resolving
- Implement lidar decoding
- Add devcontainer template
- Create a FastAPI and/or FastMCP layer
- Add more documentation
Coming soon.
