unitree_rl_gym/doc/setup_en.md

3.5 KiB
Raw Permalink Blame History

Installation Guide

System Requirements

  • Operating System: Recommended Ubuntu 18.04 or later
  • GPU: Nvidia GPU
  • Driver Version: Recommended version 525 or later

1. Creating a Virtual Environment

It is recommended to run training or deployment programs in a virtual environment. Conda is recommended for creating virtual environments. If Conda is already installed on your system, you can skip step 1.1.

1.1 Download and Install MiniConda

MiniConda is a lightweight distribution of Conda, suitable for creating and managing virtual environments. Use the following commands to download and install:

mkdir -p ~/miniconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm ~/miniconda3/miniconda.sh

After installation, initialize Conda:

~/miniconda3/bin/conda init --all
source ~/.bashrc

1.2 Create a New Environment

Use the following command to create a virtual environment:

conda create -n unitree-rl python=3.8

1.3 Activate the Virtual Environment

conda activate unitree-rl

2. Installing Dependencies

2.1 Install PyTorch

PyTorch is a neural network computation framework used for model training and inference. Install it using the following command:

conda install pytorch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1 pytorch-cuda=12.1 -c pytorch -c nvidia

2.2 Install Isaac Gym

Isaac Gym is a rigid body simulation and training framework provided by Nvidia.

2.2.1 Download

Download Isaac Gym from Nvidias official website.

2.2.2 Install

After extracting the package, navigate to the isaacgym/python folder and install it using the following commands:

cd isaacgym/python
pip install -e .

2.2.3 Verify Installation

Run the following command. If a window opens displaying 1080 balls falling, the installation was successful:

cd examples
python 1080_balls_of_solitude.py

If you encounter any issues, refer to the official documentation at isaacgym/docs/index.html.

2.3 Install rsl_rl

rsl_rl is a library implementing reinforcement learning algorithms.

2.3.1 Download

Clone the repository using Git:

git clone https://github.com/leggedrobotics/rsl_rl.git

2.3.2 Switch Branch

Switch to the v1.0.2 branch:

cd rsl_rl
git checkout v1.0.2

2.3.3 Install

pip install -e .

2.4 Install unitree_rl_gym

2.4.1 Download

Clone the repository using Git:

git clone https://github.com/unitreerobotics/unitree_rl_gym.git

2.4.2 Install

Navigate to the directory and install it:

cd unitree_rl_gym
pip install -e .

2.5 Install unitree_sdk2py (Optional)

unitree_sdk2py is a library used for communication with real robots. If you need to deploy the trained model on a physical robot, install this library.

2.5.1 Download

Clone the repository using Git:

git clone https://github.com/unitreerobotics/unitree_sdk2_python.git

2.5.2 Install

Navigate to the directory and install it:

cd unitree_sdk2_python
pip install -e .

Summary

After completing the above steps, you are ready to run the related programs in the virtual environment. If you encounter any issues, refer to the official documentation of each component or check if the dependencies are installed correctly.