gym-pybullet-drones

PyBullet Gymnasium environments for single and multi-agent reinforcement learning of quadcopter control

https://github.com/utiasdsl/gym-pybullet-drones

Science Score: 77.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
    Links to: arxiv.org
  • Committers with academic emails
    2 of 17 committers (11.8%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.2%) to scientific vocabulary

Keywords

betaflight control crazyflie gym gymnasium multi-agent pybullet quadcopter quadrotor reinforcement-learning robotics sitl stable-baselines3 uav
Last synced: 6 months ago · JSON representation ·

Repository

PyBullet Gymnasium environments for single and multi-agent reinforcement learning of quadcopter control

Basic Info
Statistics
  • Stars: 1,603
  • Watchers: 18
  • Forks: 452
  • Open Issues: 110
  • Releases: 5
Topics
betaflight control crazyflie gym gymnasium multi-agent pybullet quadcopter quadrotor reinforcement-learning robotics sitl stable-baselines3 uav
Created over 5 years ago · Last pushed 6 months ago
Metadata Files
Readme License Citation

README.md

gym-pybullet-drones

This is a minimalist refactoring of the original gym-pybullet-drones repository, designed for compatibility with gymnasium, stable-baselines3 2.0, and SITL betaflight/crazyflie-firmware.

NOTE: if you prefer to access the original codebase, presented at IROS in 2021, please git checkout [paper|master] after cloning the repo, and refer to the corresponding README.md's.

formation flight control info

[!TIP] If you are looking for symbolic dynamics, check out safe-control-gym instead

If you are looking for PX4/ArduPilot support, check out aerial-autonomy-stack instead

Installation

Tested on Intel x64/Ubuntu 22.04 and Apple Silicon/macOS 14.1.

```sh 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 . # if needed, sudo apt install build-essential to install gcc and build pybullet

```

Use

PID control examples

sh cd gym_pybullet_drones/examples/ python3 pid.py # position and velocity reference python3 pid_velocity.py # desired velocity reference

Downwash effect example

sh cd gym_pybullet_drones/examples/ python3 downwash.py

Reinforcement learning examples (SB3's PPO)

sh cd gym_pybullet_drones/examples/ python learn.py # task: single drone hover at z == 1.0 python learn.py --multiagent true # task: 2-drone hover at z == 1.2 and 0.7 LATEST_MODEL=$(ls -t results | head -n 1) && python play.py --model_path "results/${LATEST_MODEL}/best_model.zip" # play and visualize the most recent learned policy after training

rl example marl example

utiasDSL pycffirmware Python Bindings example (multiplatform, single-drone)

Install pycffirmware for Ubuntu, macOS, or Windows

sh cd gym_pybullet_drones/examples/ python3 cff-dsl.py

Betaflight SITL example (Ubuntu only)

sh git clone https://github.com/betaflight/betaflight cd betaflight/ git checkout cafe727 # `master` branch head at the time of writing (future release 4.5) make arm_sdk_install # if needed, `apt install curl`` make TARGET=SITL # comment out line: https://github.com/betaflight/betaflight/blob/master/src/main/main.c#L52 cp ~/gym-pybullet-drones/gym_pybullet_drones/assets/eeprom.bin ~/betaflight/ # assuming both gym-pybullet-drones/ and betaflight/ were cloned in ~/ betaflight/obj/main/betaflight_SITL.elf

In another terminal, run the example

sh conda activate drones cd gym_pybullet_drones/examples/ python3 beta.py --num_drones 1 # check the steps in the file's docstrings to use multiple drones

Citation

If you wish, please cite our IROS 2021 paper (and original codebase) as

bibtex @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

Run all tests from the top folder with

sh pytest tests/


University of Toronto's Dynamic Systems Lab / Vector Institute / University of Cambridge's Prorok Lab

Owner

  • Name: Dynamic Systems Lab
  • Login: utiasDSL
  • Kind: organization

Citation (CITATION.cff)

cff-version: 1.2.0
preferred-citation:
  type: article
  authors:
  - family-names: "Panerati"
    given-names: "Jacopo"
    orcid: "https://orcid.org/0000-0003-2994-5422"
  - family-names: "Zheng"
    given-names: "Hehui"
    orcid: "https://orcid.org/0000-0002-4977-0220"
  - family-names: "Zhou"
    given-names: "SiQi"
  - family-names: "Xu"
    given-names: "James"
  - family-names: "Prorok"
    given-names: "Amanda"
    orcid: "https://orcid.org/0000-0001-7313-5983"
  - family-names: "Schoellig"
    given-names: "Angela P."
    orcid: "https://orcid.org/0000-0003-4012-4668"
  doi: "10.0000/00000"
  journal: "2021 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)"
  month: 1
  start: 1 # First page number
  end: 8 # Last page number
  title: "Learning to Fly---a Gym Environment with PyBullet Physics for Reinforcement Learning of Multi-agent Quadcopter Control"
  issue: 1
  volume: 1
  year: 2021

GitHub Events

Total
  • Issues event: 20
  • Watch event: 354
  • Issue comment event: 54
  • Push event: 4
  • Pull request review comment event: 2
  • Pull request review event: 3
  • Pull request event: 14
  • Fork event: 99
Last Year
  • Issues event: 20
  • Watch event: 354
  • Issue comment event: 54
  • Push event: 4
  • Pull request review comment event: 2
  • Pull request review event: 3
  • Pull request event: 14
  • Fork event: 99

Committers

Last synced: 9 months ago

All Time
  • Total Commits: 775
  • Total Committers: 17
  • Avg Commits per committer: 45.588
  • Development Distribution Score (DDS): 0.075
Past Year
  • Commits: 5
  • Committers: 3
  • Avg Commits per committer: 1.667
  • Development Distribution Score (DDS): 0.6
Top Committers
Name Email Commits
Jacopo Panerati j****i@r****a 717
Spencer Teetaert s****t@g****m 34
Hany Hamed h****r@g****m 3
Hehui Zheng 5****g 3
hidal00p a****k@p****e 3
Ben Sprenger b****r@a****m 2
Dominik Helfenstein 4****1 2
Yvo Keuter y****r@g****m 2
AnaLys 7****s 1
Auki 5****2 1
Beomyeol Yu y****l@g****m 1
Felix Büttner 3****r 1
Honungsburken j****g@g****m 1
James Xu j****u@g****m 1
SiQi Zhou s****u@r****a 1
Jacopo Panerati j****o@J****l 1
Umut Kaan Kavaklı 6****i 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 108
  • Total pull requests: 35
  • Average time to close issues: 2 months
  • Average time to close pull requests: 16 days
  • Total issue authors: 77
  • Total pull request authors: 25
  • Average comments per issue: 3.21
  • Average comments per pull request: 0.77
  • Merged pull requests: 16
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 26
  • Pull requests: 12
  • Average time to close issues: 10 days
  • Average time to close pull requests: 6 days
  • Issue authors: 19
  • Pull request authors: 8
  • Average comments per issue: 1.81
  • Average comments per pull request: 0.25
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • Astik-2002 (9)
  • HimGautam (7)
  • zcase (6)
  • Fatimah-Alahmed (3)
  • kevin-thankyou-lin (3)
  • shanki98 (3)
  • thaipduong (3)
  • piratax007 (2)
  • xuan-mxx (2)
  • LvXinyu2003 (2)
  • azamkamranian (2)
  • chris-aeviator (2)
  • abdul-mannan-khan (2)
  • DoverDW (2)
  • JGittles (2)
Pull Request Authors
  • JacopoPan (5)
  • hany606 (4)
  • HehuiZheng (3)
  • bsprenger (2)
  • iitimii (2)
  • yashrbhutada (2)
  • FabianDumitrascu (2)
  • iimmer (2)
  • luizgiacomossi (2)
  • rogoncalo (2)
  • Thiagodcv (2)
  • tvanderweij (2)
  • domhel (1)
  • seolhokim (1)
  • therealjtgill (1)
Top Labels
Issue Labels
question (63) bug (11) enhancement (8) invalid (5) documentation (4)
Pull Request Labels
enhancement (9) bug (3) question (1)

Packages

  • Total packages: 2
  • Total downloads: unknown
  • Total dependent packages: 0
    (may contain duplicates)
  • Total dependent repositories: 0
    (may contain duplicates)
  • Total versions: 10
proxy.golang.org: github.com/utiasdsl/gym-pybullet-drones
  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 6.5%
Average: 6.7%
Dependent repos count: 6.9%
Last synced: 6 months ago
proxy.golang.org: github.com/utiasDSL/gym-pybullet-drones
  • Versions: 5
  • Dependent Packages: 0
  • Dependent Repositories: 0
Rankings
Dependent packages count: 6.5%
Average: 6.7%
Dependent repos count: 6.9%
Last synced: 6 months ago

Dependencies

.github/workflows/push.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
.github/workflows/release.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
  • pypa/gh-action-pypi-publish master composite
pyproject.toml pypi
  • gymnasium ^0.28
  • matplotlib ^3.7
  • numpy ^1.24
  • pybullet ^3.2.5
  • pytest ^7.3
  • python ^3.10
  • scipy ^1.10
  • stable-baselines3 ^2.0.0
  • transforms3d ^0.4.1