This is a (minimalist) refactoring of the original gym-pybullet-drones
repository, designed for compatibility with gymnasium
and stable-baselines3
2.0.
git clone https://github.com/utiasDSL/gym-pybullet-drones.git
cd gym-pybullet-drones/
conda create -n drones python=3.10
conda activate drones
pip3 install --upgrade pip
pip3 install -e .
At the time of writing, stable-baselines3
2.0's alpha can be installed from PyPI
pip3 install "sb3_contrib>=2.0.0a1" --upgrade
pip3 install "stable_baselines3>=2.0.0a1" --upgrade
cd gym_pybullet_drones/examples/
python3 pid.py
cd gym_pybullet_drones/examples/
python3 learn.py
In one terminal, run the Betaflight SITL binary
git clone https://github.com/betaflight/betaflight
cd betaflight/
make TARGET=SITL # comment out this line: https://github.com/betaflight/betaflight/blob/c41b458e5891205da50465caeec0c1aa83beeb0c/src/main/main.c#L52
betaflight/obj/main/betaflight_SITL.elf
In another terminal, run the example
cd gym_pybullet_drones/examples/
python3 beta.py
- On Ubuntu, with an NVIDIA card, if you receive a "Failed to create and OpenGL context" message, launch
nvidia-settings
and under "PRIME Profiles" select "NVIDIA (Performance Mode)", reboot and try again.
If you wish, please cite our IROS 2021 paper as
@INPROCEEDINGS{panerati2021learning,
title={Learning to Fly---a Gym Environment with PyBullet Physics for Reinforcement Learning of Multi-agent Quadcopter Control},
author={Jacopo Panerati and Hehui Zheng and SiQi Zhou and James Xu and Amanda Prorok and Angela P. Schoellig},
booktitle={2021 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)},
year={2021},
volume={},
number={},
pages={7512-7519},
doi={10.1109/IROS51168.2021.9635857}
}
- Nathan Michael, Daniel Mellinger, Quentin Lindsey, Vijay Kumar (2010) The GRASP Multiple Micro UAV Testbed
- Benoit Landry (2014) Planning and Control for Quadrotor Flight through Cluttered Environments
- Julian Forster (2015) System Identification of the Crazyflie 2.0 Nano Quadrocopter
- Carlos Luis and Jeroome Le Ny (2016) Design of a Trajectory Tracking Controller for a Nanoquadcopter
- Shital Shah, Debadeepta Dey, Chris Lovett, and Ashish Kapoor (2017) AirSim: High-Fidelity Visual and Physical Simulation for Autonomous Vehicles
- Eric Liang, Richard Liaw, Philipp Moritz, Robert Nishihara, Roy Fox, Ken Goldberg, Joseph E. Gonzalez, Michael I. Jordan, and Ion Stoica (2018) RLlib: Abstractions for Distributed Reinforcement Learning
- Antonin Raffin, Ashley Hill, Maximilian Ernestus, Adam Gleave, Anssi Kanervisto, and Noah Dormann (2019) Stable Baselines3
- Guanya Shi, Xichen Shi, Michael O’Connell, Rose Yu, Kamyar Azizzadenesheli, Animashree Anandkumar, Yisong Yue, and Soon-Jo Chung (2019) Neural Lander: Stable Drone Landing Control Using Learned Dynamics
- Mikayel Samvelyan, Tabish Rashid, Christian Schroeder de Witt, Gregory Farquhar, Nantas Nardelli, Tim G. J. Rudner, Chia-Man Hung, Philip H. S. Torr, Jakob Foerster, and Shimon Whiteson (2019) The StarCraft Multi-Agent Challenge
- C. Karen Liu and Dan Negrut (2020) The Role of Physics-Based Simulators in Robotics
- Yunlong Song, Selim Naji, Elia Kaufmann, Antonio Loquercio, and Davide Scaramuzza (2020) Flightmare: A Flexible Quadrotor Simulator
- IMU transforms in Betaflight SITL example
- Flatten
dict
observations/action intonp.array
s (with wrapper?) - Replace
aggregate_phy_steps
with simulation and control frequencies - Add motor delay
- Replace
rpy
with quaternions andang_vel
with body rates - Replace
BaseSingleAgentAviary
andBaseMultiAgentAviary
withRLAviary
- Add pointer in
README.md
to the originalmaster
branch - Add
yaml
configuration files - Add
stable-baselines3
2.0 support/examples - Add
pytest
s/GitHub Action for learning examples - Add
cffirmware
SITL support
University of Toronto's Dynamic Systems Lab / Vector Institute / University of Cambridge's Prorok Lab