A Python interface and simulation environemtn for the Unitree Go2 robot.
Go to file
Rooholla-KhorramBakht 497d0c17d4 Mid360 lidar service is added 2024-12-27 10:03:02 +08:00
.devcontainer D1 arm assets added and ocp example updated. 2024-12-03 11:06:54 -05:00
Go2Py D1 arm assets added and ocp example updated. 2024-12-03 11:06:54 -05:00
deploy Mid360 lidar service is added 2024-12-27 10:03:02 +08:00
docker restamped utlidar publisher is added 2024-06-24 05:16:35 +08:00
docs Update setup.md 2024-12-26 18:35:36 -05:00
examples D1 arm assets added and ocp example updated. 2024-12-03 11:06:54 -05:00
go2py_messages autopep8 is applied 2024-05-20 18:45:59 -04:00
scripts devcontainer docker support and DDS network interfcace configuraion settings are added 2024-09-30 17:38:26 -04:00
.flake8 go2py devcontainer is added 2024-05-03 20:51:20 -04:00
.gitattributes obj and dae files are moved to main repo 2024-10-01 14:26:53 -04:00
.gitignore Minor examples cleanup. 2024-11-05 23:37:59 +00:00
.gitmodules m-explore submodule is added 2024-07-29 02:22:32 -04:00
LICENSE Initial commit 2023-10-27 12:15:40 -04:00
MANIFEST.in devcontainer docker support and DDS network interfcace configuraion settings are added 2024-09-30 17:38:26 -04:00
Makefile Mid360 lidar service is added 2024-12-27 10:03:02 +08:00
README.md Update README.md 2024-05-20 21:00:38 -04:00
multicast_config.py devcontainer docker support and DDS network interfcace configuraion settings are added 2024-09-30 17:38:26 -04:00
setup.cfg D1 arm assets added and ocp example updated. 2024-12-03 11:06:54 -05:00
setup.py setup files updated 2024-05-20 19:01:56 -04:00

README.md

Go2Py

Go2Py is a Pythonic interface and driver for low-level and high-level control of Unitree Go2 quadruped robots. The motivation of this project is to remove the burden of developing interface, safety systems, and basic components required for starting locomotion research using the Go2 quadruped robot. It provides a modular pipeline for real-time communication with the robot in both simulated and real-world environments with a unified interface.

image

This project is comprised of the following components:

  • C++ Bridge: A dockerized ROS2 bridge built upon the unitree_ros2 that implements a remote-controlled emergency stop and publishes the robot states as standard ROS2 topics usable by upstream systems such as NAV2.
  • Robot Interface: A simple Python class that represents the robot and communicates with the C++ bridge through either DDS (ROS independent) or ROS2 interfaces.
  • Robot Management FSM: A finite state machine for controlling the behavior of the robot up to the point of handover to the user low-level controller (sitting down, standing up) with safety monitors (motor temperatures, emergency stops).
  • Robot Model: A simple to use Pinocchio wrapper for computing the kinematics and dynamics parameters of the robot.
  • Simulation Interface: Simulation environments based on Mujoco and Nvidia Orbit (To be added) with a Python interface identical to the real robot.

How Does Using it Look Like?

Communication with the robot will be as simple as importing a Python class:

from Go2Py.robot.interface.dds import GO2Real
from Go2Py.robot.model import Go2Model
robot = GO2Real(mode='lowlevel')
model = Go2Model()
while running:
    joint_state = robot.getJointStates()
    imu = robot.getIMU()
    remote = robot.getRemoteState()
    model.update(state['q'], state['dq'],T,vel) # T and vel from the EKF
    info = model.getInfo()
    
    #User control computations ...

    robot.setCommands(q_des, dq_des, kp, kd, tau_ff)

An identical workflow can be followed for simulation:

from Go2Py.sim.mujoco import Go2Sim
from Go2Py.robot.model import Go2Model
robot = Go2Sim()
model = Go2Model()
robot.standDownReset()
while running:
    joint_state = robot.getJointStates()
    imu = robot.getIMU()
    remote = robot.getRemoteState()
    model.update(state['q'], state['dq'],T,vel) # T and vel from the EKF
    info = model.getInfo()

    #User control computations ...

    robot.setCommands(q_des, dq_des, kp, kd, tau_ff)
    robot.step()

Installation

Follow through the steps here to setup the robot and Go2Py.

Examples

A set of examples and tutorials are provided to get you up and running quickly: