Skip to main content

FlySim

A minimal but complete 3D drone simulator with real-time OpenGL rendering, lighting, shadow, and three input methods: keyboard, mouse, and the WFLY ET16S RC transmitter over USB HID.

Features

  • Real-time 3D rendering (pygame + PyOpenGL): perspective camera, depth test, per-vertex lighting (ambient + diffuse), smooth shading
  • Tiled checkerboard ground with cardinal direction markers (N/E arrows)
  • Point light source (yellow sphere) with ambient + diffuse components
  • Soft blob shadow projected under the drone
  • Drone model: body, 4 arms, 4 motors, independently spinning propellers (speed scales with throttle + differential for pitch/roll/yaw)
  • Payload box hanging by a rope below the drone (swings with acceleration)
  • Front markers: two red squares on the nose; rear marker: green triangle
  • Third-person orbit camera (mouse drag = orbit, wheel = zoom)
  • Flight telemetry HUD: position (N/E/Alt from takeoff), heading, pitch/roll, speed, acceleration, velocity vector
  • Live RC transmitter visualization panel (twin-stick, Mode 2)
  • Fully configurable HID axis mapping (axis index + sign per channel)
  • Live-tunable physics: max tilt, pitch/roll/throttle force, yaw rate, damping
  • Persistent config: axismap.txt and tuning.txt auto-loaded/saved

Install

pip install dronesim

Or from source:

git clone https://github.com/CodeOfMe/FlySim.git
cd FlySim
pip install -e .

Run

dronesim          # installed entry point
# or
python -m dronesim

Requirements

  • Python >= 3.10
  • pygame >= 2.4, PyOpenGL >= 3.1.7, numpy >= 1.24

Controls

Keyboard

Action Keys
Forward / back (pitch) W / S or Up / Down
Strafe left / right (roll) A / D or Left / Right
Yaw left / right Q / E
Throttle up / down Shift / Ctrl
Orbit camera Mouse drag
Zoom Mouse wheel
Pause P
Reset drone R
Toggle help H
Toggle axis editor F1
Quit ESC

WFLY ET16S (HID, Mode 2 / USA transmitter)

Action Stick
Throttle (up/down) Left stick Y
Yaw (turn) Left stick X
Pitch (forward/back) Right stick Y
Roll (left/right) Right stick X

The HID input is auto-detected. If any ET16S stick moves beyond its deadzone, it takes priority over the keyboard.

Live HID axis configuration

Press F1 to open the axis editor. Then:

Key Action
1 / 2 / 3 / 4 Select channel: throttle / yaw / pitch / roll
[ / ] Decrement / increment axis index
; / ' Flip sign for current channel
F2 Save axis map to axismap.txt

Live physics tuning

Key Action
F3 Select max_tilt_deg
F4 Select pitch_force
F5 Select roll_force
F6 Select throttle_force
F7 Select yaw_rate
F8 Select damping
+ / - Increase / decrease selected parameter
F9 Save tuning to tuning.txt
F10 Load tuning from tuning.txt

Scene

  • Ground: 40 x 40 m checkerboard with N (red) and E (blue) arrows, origin cross
  • Light: point light at (20, 30, 15) with ambient + diffuse
  • Shadow: soft radial blob projected on ground under the drone
  • Drone: body + 4 arms + 4 motors + spinning props + payload on rope
  • Camera: third-person orbit, follows the drone

Coordinate system

  • Origin = takeoff point on the ground
  • North = -Z, South = +Z, East = +X, West = -X, Up = +Y
  • yaw = 0 faces North; yaw increases clockwise (top view)

License

GPL-3.0-or-later. See LICENSE.

Metadata

Release files for flysim 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flysim 1.0.0
File Size Uploaded Provenance
flysim-1.0.0.tar.gz 1.1 MB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for flysim 1.0.0
File Interpreter ABI Platform
flysim-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 2.2 MB

Release files / flysim-1.0.0.tar.gz

Download URL flysim-1.0.0.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
9f7eea8185b09c3b4a3538ce2a1733f1b613a1fab8809ebbda923f33c2f2499e
BLAKE2b-256 checksum
How to use checksums
8d541cf431aabb2cfbef364fe54ff37d8e28c983ce8cf88bc0e9ece8dae62baa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Release files / flysim-1.0.0-py3-none-any.whl

Download URL flysim-1.0.0-py3-none-any.whl
Size 1.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
6f57bd5d617d179dc839909cc103581882758b7340c132e6e6cec89639d12e93
BLAKE2b-256 checksum
How to use checksums
b64118cd77f22575961700bed1299b541b3eb1668eee89b1ff9dc2f95186d299
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.12

Security for flysim 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page