Repo symbol

go2_rl_ws repository

Repo symbol

go2_rl_ws repository

Repo symbol

go2_rl_ws repository

Repo symbol

go2_rl_ws repository

Repository Summary

Description Go2 RL Deployment (ROS2 Humble)
Checkout URI https://github.com/eppl-erau-db/go2_rl_ws.git
VCS Type git
VCS Version main
Last Updated 2024-09-10
Dev Status UNKNOWN
Released UNRELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

README

RL Control and Navigation Deployment - Unitree Go2

Introduction and Scope

This repository contains a ROS2 Humble workspace allowing for the real world implementation of a trained RL policy on the Go2. Currently, there is support for locomotion policies and 2D navigation policies (without obstacle avoidance). To train the RL policies, Isaac Lab was used.

Policy Information

Locomotion models can be found in the share directory of the unitree_ros2_python package. Navigation models can be found in the share directory of the rl_navigation package. They are in the ONNX format for maximum compatibility.

Note that the observations tensor has been edited to not include the height scan or the base linear velocities as these are not easily attainable in low state, which the robot has to be in to deliver low level commands. Development is currently underway in LiDAR decoding for height map information and sensor fusion for linear velocity information, as well as support for 3D navigation.

FlowCharts

Here is the current configuration of the locomotion policies:

RL Control FlowChart

Here is the current configuration of the navigation policies:

RL Navigation FlowChart

Setup

Before setup, ensure you have installed ROS2 Humble and are familiar to connecting your system to the Go2, through ethernet, referring to Unitree’s documentation.

To start, clone this repository into your ROS2 workspaces directory:

cd ~/workspaces
git clone --recurse-submodules https://github.com/eppl-erau-db/go2_rl_ws

Resolving dependencies:

pip install onnxruntime-gpu # or onnxruntime-cpu
sudo apt install ros-humble-rmw-cyclonedds-cpp
sudo apt install ros-humble-rosidl-generator-dds-idl

Ensuring you have not sourced ROS2, compile cyclonedds:

cd ~/workspaces/go2_rl_ws/src/unitree_ros2/cyclonedds_ws/src
git clone https://github.com/ros2/rmw_cyclonedds -b humble
git clone https://github.com/eclipse-cyclonedds/cyclonedds -b releases/0.10.x
cd ..
colcon build --packages-select cyclonedds

Source ros and build unitree ROS2:

source /opt/ros/humble/setup.bash
colcon build

Connecting the ethernet cord to the quadruped, get the name of the connection:

ifconfig

After using ifconfig to get name of connection, edit the unitree_ros2’s setup.sh file. Using enp114s0 as an example:

sudo gedit ~/workspaces/go2_rl_ws/src/unitree_ros2/setup.sh

#!/bin/bash
echo "Setup unitree ros2 environment"
source /opt/ros/humble/setup.bash
source ~/workspaces/go2_rl_ws/src/unitree_ros2/cyclonedds_ws/install/setup.bash
export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
export CYCLONEDDS_URI='<CycloneDDS><Domain><General><Interfaces>
                            <NetworkInterface name="enp114s0" priority="default" multicast="default" />
                        </Interfaces></General></Domain></CycloneDDS>'

Also using the name of the connection, you will have to set it as the paramter in the launch files, for the basic deployment example you will only have to update go2_walk_nodes_onnx.launch.py. Again using enp114s0 as an example:

gedit ~/workspaces/go2_rl_ws/src/go2_launch/launch/go2_walk_nodes_onnx.launch.py

def generate_launch_description():
    # Shared parameters
    shared_params = {'network_interface': "enp114s0"}  # TODO: CHANGE TO YOUR INTERFACE NAME

Then, make the setup.bash an executable and run it:

cd ~/workspaces/go2_rl_ws &&
chmod +x setup.bash &&
source ./setup.bash

Finally, restart your PC, as recommended by Unitree.

Body Control Deployment

To deploy, ensure the quadraped is LYING DOWN with SPORT MODE OFF (do so in the app), as support for switching modes is not yet integrated. Tethering the top of the quadruped is also advised. Work is underway for better and safer testing. Here is the wireless remote control mapping:

Wireless Remote Mapping

UP –> Stand Command

File truncated at 100 lines see the full file

Repo symbol

go2_rl_ws repository

Repo symbol

go2_rl_ws repository

Repo symbol

go2_rl_ws repository

Repo symbol

go2_rl_ws repository