A legged_gym based framework for training legged robots in genesis
- Create a new python virtual env with python==3.10
- Install pytorch for rocm
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm6.2.4
- Must use pip install; use newest Genesis will cause some error
pip install genesis-world==0.2.1
- Install rsl_rl and tensorboard
# Install rsl_rl. git clone https://github.com/leggedrobotics/rsl_rl cd rsl_rl && git checkout v1.0.2 && pip install -e . --use-pep517
- Install dependency
git clone https://github.com/JingXunLin/Genesis_Go2.git cd Genesis_Go2 pip install -e . pip install open3d tensorboard pygame trimesh pip install libigl==2.5.1
- Fix OpenGL error
conda install -c conda-forge libstdcxx-ng Modify ~/miniconda3/envs/{你的環境名字}/lib/python3.10/site-packages/genesis/ext/pyrender/constants.py TARGET_OPEN_GL_MAJOR = 3 # Target OpenGL Major Version TARGET_OPEN_GL_MINOR = 3 # Target OpenGL Minor Version
By default, the task is set to go2(in utils/helper.py), we can run a training session with the following command:
cd legged_gym/scripts
python train.py --headless --max_iterations=1000 # run training without renderingAfter the training is done, paste the run_name under logs/go2 to load_run in go2_config.py:
Then, run play.py to visualize the trained model.
vglrun python play.py --task=go2_rough
vglrun python play.py --task=go2 #瞎子版本 只走平地operation : W前進,S後退,Q左轉,E右轉,空白隨機踢飛(一定要在pygame視窗裡操作)
For more detailed instructions, please refer to the wiki page