Skip to main content

Training and Play

Wiki-GRx-Gym provides a training environment based on NVIDIA Isaac Gym, combined with the legged_gym and rsl_rl libraries from the Legged Robotics team at ETH Zurich, for training the Fourier N1 robot's walking ability on complex terrain.

Installation Guide

  1. Install Ubuntu 20.04 / Ubuntu 22.04 system

  2. Conda Environment Configuration

    # Install Miniconda
    cd ~/Downloads
    wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
    bash Miniconda3-latest-Linux-x86_64.sh

    # Create training environment
    conda create -n wiki-grx-gym python=3.8 -y
    conda activate wiki-grx-gym
  3. Dependency Installation

    # Navigate to the project directory
    cd path/to/your/project

    # Install Isaac Gym
    cd IsaacGym_Preview_4_Package/isaacgym/python/
    pip install -e . -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple

    # Navigate to the project directory
    cd path/to/your/project

    # Install rsl_rl
    cd rsl_rl
    pip install -e . -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple

    # Navigate to the project directory
    cd path/to/your/project

    # Install legged_gym
    cd legged_gym
    pip install -e . `-i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple`

    # Install other dependencies
    pip install tensorboard protobuf==3.20.3 -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple

Usage Instructions

  1. Start Training

    cd legged_gym/legged_gym/scripts
    python train.py --task=N1 --headless
  2. Demonstration Test

    python play.py --task=N1 --num_envs=1
  3. Export Policy

    • When running play.py, the policy network model will be automatically exported to logs/N1/exported/policy_jit.pt.
    • This policy model can be used for subsequent deployment on the real robot.

[!NOTE]

The average training time using NVIDIA RTX 4090 is about 6 seconds per iteration. Completing 5000 iterations takes approximately 8 hours. Actual training time can be adjusted based on reward growth and training objectives.

Common Issues

  1. Ubuntu 22.04 reports error "libpython3.8.so.1.0: cannot open shared object file"

    • The displayed information is: ImportError: libpython3.8.so.1.0: cannot open shared object file: No such file or directory
    • Solution reference: https://blog.csdn.net/weixin_43989965/article/details/136612205
    • You can try activating the wiki-grx-gym environment first, running the automatic configuration script in this project, then exiting the conda environment, and then reactivating the corresponding conda environment:
    conda activate wiki-grx-gym
    bash shell/conda_import_libpython.sh
    conda deactivate
    conda activate wiki-grx-gym