Skip to content

Software

gym-pybullet-drones

By Learning Systems and Robotics Lab (LSY), Germany (checked on github.com/learnsyslab (opens in a new tab)), from github.com/learnsyslab/gym-pybullet-drones (opens in a new tab)

  • Drones and boats
  • Simulator
  • MIT

A minimalist Gymnasium-compatible quadcopter simulation environment built on PyBullet physics, for control and reinforcement learning research with multiple drones.

Facts

GitHub stars
2,219read on 28 Nov 2026
Last update
21 Nov 2026Newest commit on main
Maintenance
Activea commit in the last 90 days
Difficulty
Intermediate
Hardware it needs, as the project states it
Tested on Intel x64 with Ubuntu 24.04 and on Apple Silicon with macOS 26. The Betaflight SITL example is Ubuntu only.

Checked on GitHub on 28 Nov 2026.

Licenses

Code
MIT (opens in a new tab)

Read by Robotheca from LICENSE (opens in a new tab) (MIT) at commit 781e434 (opens in a new tab), on 28 Nov 2026.

Commercial use
Yes

At a glance

What it is
  • Provides a refactored, Gymnasium- and stable-baselines3-compatible drone environment built on PyBullet.
  • Includes PID and velocity control examples, plus an MRAC controller example.
  • Offers a downwash effect example showing aerodynamic interaction between drones.
  • Supports single-agent and multi-agent reinforcement learning examples using PPO from stable-baselines3.
  • Includes a Betaflight SITL example for running simulated flight controllers, one per drone.
  • Ships a pytest test suite that can be run from the repository root.

Robotheca's summary of the project's documents, not the creator's words.

Robots on Robotheca
No robot on Robotheca uses it yet.
Licence
MIT. Commercial use: Yes. Where it was read
Install
In the creator's words: The project's website (opens in a new tab)
Maintenance
Active, last commit on 21 Nov 2026.

Use it

How to install it, in the creator's words: The project's website (opens in a new tab)

Robotheca doesn't review code. Read it before running it.

Files and versions

Facts read at commit 781e434

Robotheca read the repository at two versions: the summary at 0156312 and the facts and the README at 781e434 (read on 28 Nov 2026).

Robotheca never hosts the code: each link goes to the creator's own page.

The README

The creator's own README, copied as written: README.md by Learning Systems and Robotics Lab (LSY), at commit 781e434, under MIT (opens in a new tab). The original on GitHub (opens in a new tab).

Read the README here

[!TIP] For research work with symbolic dynamics and constraints, also try safe-control-gym (opens in a new tab)

For GPU-accelerated, differentiable, JAX-based simulation, also try crazyflow (opens in a new tab)

For real-world deployment of PX4/ArduPilot + ROS2 + JetPack, use aerial-autonomy-stack (opens in a new tab)

gym-pybullet-drones

This is a minimalist refactoring of the original gym-pybullet-drones repository, designed for compatibility with gymnasium (opens in a new tab), stable-baselines3 2.0 (opens in a new tab), and betaflight (opens in a new tab) SITL.

NEWS: gym-pybullet-drones was featured in GitHub's Maintainer Spotlight 2026 (opens in a new tab)

NOTE: if you want to access the original IROS 2021 codebase, please git checkout [paper|master]

formation flight control info

Installation

Tested on Intel x64/Ubuntu 24.04 and Apple Silicon/macOS 26.

git clone https://github.com/learnsyslab/gym-pybullet-drones.git
cd gym-pybullet-drones/

conda create -n drones python=3.12
conda activate drones

# Beyond Python 3.10, `pybullet` has no pre-built wheel
# On Ubuntu, install `gcc` to let `pip3 install` build `pybullet`
sudo apt install build-essential
# On macOS, build and install `pybullet` with
CFLAGS="-Dfdopen=fdopen" pip install pybullet --no-cache-dir

pip3 install -e .

# check installed packages with `conda list`, deactivate with `conda deactivate`, remove with `conda remove -n drones --all`
Use
Control examples
cd gym_pybullet_drones/examples/
python3 pid.py
python3 pid_velocity.py
python3 mrac.py
Downwash effect example
cd gym_pybullet_drones/examples/
python3 downwash.py
Reinforcement learning examples (SB3's PPO)
cd gym_pybullet_drones/examples/

# single agent, task: single drone hover at z == 1.0
python learn.py
LATEST_MODEL=$(ls -t results | head -n 1) && python play.py --model_path "results/${LATEST_MODEL}/best_model.zip"

# multi-agent, task: 2-drone hover at z == 1.2 and 0.7
python learn.py --multiagent true
LATEST_MODEL=$(ls -t results | head -n 1) && python play.py --multiagent true --model_path "results/${LATEST_MODEL}/best_model.zip"

rl example marl example

Multi-agent RL with PettingZoo

PettingZooWrapper exposes any multi-drone aviary through PettingZoo (opens in a new tab)'s Parallel API, with one agent per drone (drone_0, drone_1, ...). That makes it usable with MARL libraries built on PettingZoo.

from gym_pybullet_drones.envs.MultiHoverAviary import MultiHoverAviary
from gym_pybullet_drones.utils.PettingZooWrapper import PettingZooWrapper

env = PettingZooWrapper(MultiHoverAviary(num_drones=3))
observations, infos = env.reset(seed=42)
while env.agents:
    actions = {agent: env.action_space(agent).sample() for agent in env.agents}
    observations, rewards, terminations, truncations, infos = env.step(actions)
env.close()

Each agent receives its own row of the aviary's observation. The aviary's team reward and episode flags are shared by all agents, and env.state() returns every drone's kinematics for centralised critics.

cd gym_pybullet_drones/examples/

# MWE based on `learn.py --multiagent true`
python pettingzoo_multiagent.py
Betaflight SITL example (Ubuntu only)
# one-time setup: from the repo's top folder, build one SITL executable per drone (e.g. 2), if needed, `apt install curl`
cd gym-pybullet-drones/
./gym_pybullet_drones/assets/clone_bfs.sh 2

# run the example
cd gym_pybullet_drones/examples/
python3 beta.py --num_drones 2
# --num_drones must be <= the number passed to clone_bfs.sh
Run all tests
# from the repo's top folder
cd gym-pybullet-drones/
pytest tests/
Citation

If you wish, please cite our IROS 2021 paper (opens in a new tab) (and original codebase (opens in a new tab)) 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}
}
References

UTIAS / Learning Systems and Robotics Lab (opens in a new tab) / Vector Institute (opens in a new tab) / University of Cambridge's Prorok Lab (opens in a new tab)

Robotheca lists software as a reference: nothing is hosted or run here, and every fact links to where it was read.