A Python interface and simulation environemtn for the Unitree Go2 robot.
Go to file
Rooholla-KhorramBakht 549381fcc8 nav2 dockerfile is added 2024-04-23 15:08:12 -04:00
.devcontainer state estimation dataset collected 2024-04-16 22:44:05 -04:00
Go2Py robot model is updated 2024-04-13 23:00:01 -04:00
deploy go2py status publisher is added to the bridge 2024-04-16 00:29:05 -04:00
docs openfig added 2024-04-16 16:08:52 -04:00
examples python codegen is added 2024-04-17 13:54:19 -04:00
msg_sources dds lowlevel interface is added 2024-03-10 18:27:42 -04:00
.gitignore cbf_nav2 launch file is added 2024-04-22 09:41:28 +08:00
Dockerfile.dock dock docker updated 2024-02-12 09:43:59 +08:00
Dockerfile.nav2 nav2 dockerfile is added 2024-04-23 15:08:12 -04:00
Dockerfile.robot robot description and camera autostart added 2024-02-13 02:51:30 +08:00
LICENSE Initial commit 2023-10-27 12:15:40 -04:00
MANIFEST.in python interface added 2024-02-09 02:20:48 +08:00
Makefile nav2 dockerfile is added 2024-04-23 15:08:12 -04:00
README.md Update README.md 2024-04-16 16:11:51 -04:00
go2py.sh Isaacsim and Mujoco simulator classes are added. 2024-02-20 22:27:08 -05:00
pin_model.ipynb actuatornet notebook added 2024-03-28 13:32:00 -04:00
req.py switch to lowlevel mode key added to the bridge 2024-04-16 00:05:02 -04:00
rl_environment.yml isaacgym environment added 2024-02-14 23:15:54 -05:00
setup.cfg python interface added 2024-02-09 02:20:48 +08:00
setup.py dds lowlevel interface is added 2024-03-10 18:27:42 -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 reserach using the Go2 quadruped robot. It provides a modular pipeline for real-time communication with the robot in both simulated and real world environment 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()
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)

An identical workflow is 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 in here to setup the robot and Go2Py.

Further Examples

A set of sorted examples are provided in the examples directory to get you up and running quickly:

  • High-level body velocity interface (ROS2)
  • High-level body velocity interface (DDS)
  • Low-level joint interface (ROS2)
  • Low-level joint interface (DDS)
  • Low-level simulation interface
  • Contact Force Estimation
  • Foot Contact Estimation
  • Extended Kalman Filter Legged Inertial State Estimator
  • Walk These Ways RL Controller