Skip to content

HowestAILab/unitree-go2-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Howest Unitree Go2 SDK ✨


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.

Schematic

Schematic

Project setup 🛠️

Prerequisites

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

Installation

  1. Install the required Python dependencies

    pip install -r requirements.txt
  2. Install the required Node.js dependencies

    cd server/socket
    npm install
  3. Run the signalling server

    cd server/signalling
    python main.py
  4. Run the socket server

    cd server/signalling
    node server.js
  5. You can now run the example script

    cd client
    python main.py
  6. 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()

Deployment 🚀

Coming soon.

Future improvements 💡

  • 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

Possible issues ❌

Coming soon.

About

Howest AI Lab's own custom Python SDK to control a Unitree Go2 robot dog.

Topics

Resources

Stars

Watchers

Forks