OpenAI Gym environments for a quadrotor UAV control
This repository contains OpenAI Gym environments and PyTorch implementations of TD3 and MATD3, for low-level control of quadrotor unmanned aerial vehicles. To better understand What Deep RL Do, see OpenAI Spinning UP. Please don't hesitate to create new issues or pull requests for any suggestions and corrections.
- We have recently switched from Gym to Gymnasium, but our previous Gym-based environments are still available here.
The repo was written with Python 3.11.3, Gymnasium 0.28.1, Pytorch 2.0.1, and Numpy 1.25.1.
It is recommended to create Anaconda environment with Python 3.
The official installation guide is available here.
Visual Studio Code in Anaconda Navigator
is highly recommended.
- Open your
Anaconda Prompt
and install major packages.
conda install -c conda-forge gymnasium
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
conda install -c anaconda numpy
conda install -c conda-forge vpython
- Clone the repository.
git clone https://github.com/fdcl-gwu/gym-rotor.git
Consider a quadrotor UAV below. The equations of motion are given by
The position and the velocity of the quadrotor are represented by
Env IDs | Description |
---|---|
Quad-v0 |
This serves as the foundational env for wrappers, where the state and action are represented as |
CoupledWrapper |
For single-agent RL frameworks; the observation and action are given by |
DecoupledWrapper |
For multi-agent RL frameworks; the observation and action for each agent are defined as |
where the error terms
Hyperparameters can be adjusted in args_parse.py
.
For example, training with the CMP framework can be run by
python3 main.py --framework CMP --seed 789
If you find this work useful in your own work or would like to cite it, please give credit to our work:
@article{yu2023multi,
title={Multi-Agent Reinforcement Learning for the Low-Level Control of a Quadrotor UAV},
author={Yu, Beomyeol and Lee, Taeyoung},
journal={arXiv preprint arXiv:2311.06144},
year={2023}
}
@inproceedings{yu2023equivariant,
title={Equivariant Reinforcement Learning for Quadrotor UAV},
author={Yu, Beomyeol and Lee, Taeyoung},
booktitle={2023 American Control Conference (ACC)},
pages={2842--2847},
year={2023},
organization={IEEE}
}