This project is inspired by Aerial Gym Simulator but greatly improves it.
This project provides a realistic dynamics and RL framework for Sim2Real tasks of quadcopter. Drones can be trained in AirGym and then transferred to reality.
- Ubuntu 20.04 or 22.04
- Conda or Miniconda
- NVIDIA Isaac Gym Preview 4 (Pytorch needs to upgrade for 40 series of GPUs. Please follow the installation guidance.)
Note this repository has been tested on Ubuntu 20.04/22.04 with PyTorch 2.0.0 + CUDA11.8.
- Download package from the official page and unzip.
- Edit
install_requires
inpython/setup.py
:install_requires=[ "numpy", "scipy", "pyyaml", "pillow", "imageio", "ninja", ],
- Edit
dependencies
inpython/rlgpu_conda_env.yml
:dependencies: - python=3.8 - numpy=1.20 - pyyaml - scipy - tensorboard
- Create a new conda environment named
rlgpu
and installisaacgym
:cd isaacgym ./create_conda_env_rlgpu.sh
- Install PyTorch2.0.0 and CUDA11.8:
conda activate rlgpu conda install pytorch==2.0.0 torchvision==0.15.0 torchaudio==2.0.0 pytorch-cuda=11.8 -c pytorch -c nvidia
2. Install rlPx4Controller
- Install Eigen (The recommend version is 3.3.7):
sudo apt install libeigen3-dev
- Install pybind11:
pip install pybind11
- Install rlPx4Controller
git clone [email protected]:FP-Flight/rlPx4Controller.git cd rlPx4Controller pip install -e .
git clone [email protected]:FP-Flight/AirGym.git
cd AirGym/
pip install -e .
Run the example script:
cd airgym/scripts
python example.py --controller_test
We train the model by rl-games==1.6.1.
Training:
cd airgym/rl_games/
python runner.py --headless
Algorithm related parameters can be edited in .yaml
files. Environment and simulator related parameters are located in ENV_config files like X152bPx4_config.py
.
Displaying:
cd airgym/rl_games/
python runner.py --play --num_envs 64 --checkpoint <path-to-ckpt>