Skip to main content

UAV Flight Simulator Gymnasium Environments for Reinforcement Learning Research.

Project description

PyFlyt - UAV Flight Simulator Gymnasium Environments for Reinforcement Learning Research

This is a library for testing reinforcement learning algorithms on UAVs. This repo is still under development. We are also actively looking for users and developers, if this sounds like you, don't hesitate to get in touch!

PyFlyt currently supports two separate UAV platforms:

  • QuadX UAV

    • Inspired by the original pybullet drones by University of Toronto's Dynamic Systems Lab
    • Quadrotor UAV in the X configuration
    • Actual full cascaded PID flight controller implementations for each drone.
    • Actual motor RPM simulation using first order differential equation.
    • Modular control structure
    • For developers - 8 implemented flight modes that use tuned cascaded PID flight controllers, available in PyFlyt/core/drones/quadx.py.
  • Fixedwing UAV

Table of Contents

Installation

pip3 install pyflyt

Usage

Usage is similar to any other Gymnasium and (soon) PettingZoo environment:

import gymnasium
import PyFlyt.gym_envs

env = gymnasium.make("PyFlyt/QuadX-Hover-v0")

# omit the below line to remove rendering and let
# the simulation go as fast as possible
env.render()
obs = env.reset()

done = False
while not done:
    observation, reward, termination, truncation, info = env.step(env.action_space.sample())

Environments

PyFlyt/QuadX-Hover-v0

A simple environment where an agent can learn to hover. The environment ends when either the quadcopter collides with the ground or exits the permitted flight dome.

env = gymnasium.make(
  "PyFlyt/QuadX-Hover-v0",
  flight_dome_size: float = 3.0,
  max_duration_seconds: float = 10.0,
  angle_representation: str = "quaternion",
  agent_hz: int = 40,
  render_mode: None | str = None,
)

angle_representation can be either "quaternion" or "euler".

render_mode can be either "human" or None.

PyFlyt/QuadX-Waypoints-v0

A simple environment where the goal is to fly the quadrotor to a collection of random waypoints in space within the permitted flight dome. The environment ends when either the quadrotor collides with the ground or exits the permitted flight dome.

env = gymnasium.make(
  "PyFlyt/QuadX-Waypoints-v0",
  sparse_reward: bool = False,
  num_targets: int = 4,
  use_yaw_targets: bool = False,
  goal_reach_distance: float = 0.2,
  goal_reach_angle: float = 0.1,
  flight_dome_size: float = 5.0,
  max_duration_seconds: float = 10.0,
  angle_representation: str = "quaternion",
  agent_hz: int = 30,
  render_mode: None | str = None,
)

angle_representation can be either "quaternion" or "euler".

render_mode can be either "human" or None.

PyFlyt/Fixedwing-Waypoints-v0

A simple environment where the goal is to fly a fixedwing aircraft towards set of random waypionts in space within the permitted flight dome. The environment ends when either the aircraft collides with the ground or exits the permitted flight dome.

env = gymnasium.make(
  "PyFlyt/Fixedwing-Waypoints-v0",
  sparse_reward: bool = False,
  num_targets: int = 4,
  goal_reach_distance: float = 2.0,
  flight_dome_size: float = 100.0,
  max_duration_seconds: float = 120.0,
  angle_representation: str = "quaternion",
  agent_hz: int = 30,
  render_mode: None | str = None,
)

angle_representation can be either "quaternion" or "euler".

render_mode can be either "human" or None.

Project details


Release history Release notifications | RSS feed

This version

0.5.2

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

PyFlyt-0.5.2.tar.gz (149.9 kB view details)

Uploaded Source

Built Distribution

PyFlyt-0.5.2-py3-none-any.whl (170.3 kB view details)

Uploaded Python 3

File details

Details for the file PyFlyt-0.5.2.tar.gz.

File metadata

  • Download URL: PyFlyt-0.5.2.tar.gz
  • Upload date:
  • Size: 149.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for PyFlyt-0.5.2.tar.gz
Algorithm Hash digest
SHA256 56aaccd023a4ff7f20bed4971dd411521d5a4bc5959678d3477245722d968fe6
MD5 2eb23a74fa702859e2637acfdff4c08c
BLAKE2b-256 a9d7986864b63c593f944a91f80e8bc5ac1448f4112f981b3f7a26cb8ba76184

See more details on using hashes here.

File details

Details for the file PyFlyt-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: PyFlyt-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 170.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for PyFlyt-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5a2a2ca4ac8b1d3ef65677ac4a68df23d6800aa2ccc8efe5c4fe14e2ddb4262c
MD5 9c45bda4658ffca9c1bb5950a70fe1d5
BLAKE2b-256 cf9432523349686a3866a8e76f64427832720a50b61a7fbb41a3170ec67fb0db

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page