Skip to main content

Minimal 3D drone simulator with keyboard/mouse/HID (WFLY ET16S) control, lighting, shadow, and live-tunable physics.

Project description

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.

Project details


Download files

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

Source Distribution

flysim-0.5.0.tar.gz (29.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flysim-0.5.0-py3-none-any.whl (28.5 kB view details)

Uploaded Python 3

File details

Details for the file flysim-0.5.0.tar.gz.

File metadata

  • Download URL: flysim-0.5.0.tar.gz
  • Upload date:
  • Size: 29.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for flysim-0.5.0.tar.gz
Algorithm Hash digest
SHA256 7bae5c963a556ec9e7636e48da12f14f358df907e963fe34c147e8b386a0e264
MD5 23f1b4f2fa10d38d879f234aef7b4f9e
BLAKE2b-256 cb59c47297b50fab4086ccf8e98d3f042e13fd4c8a49eb5fdd808cc8f221028c

See more details on using hashes here.

File details

Details for the file flysim-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: flysim-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 28.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for flysim-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d0db5f8c9bb7d5ee0852fc536dfd20186818a904cd0c288bd282fa68ddfc7a4b
MD5 7805c1d88a632fc6e2e34aa4f47897aa
BLAKE2b-256 2325fd7b91d724a4480b9e4fd90a24109ddd26b67e1632b8467e01730b88608c

See more details on using hashes here.

Supported by

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