Skip to content

Repository files navigation

Drone Flight Trainer

A drone-flying training tool that mimics the controls of DJI and other camera drones, so you can build muscle memory before flying the real thing. It pairs a Unity flight simulator with a native bridge that reads a DJI smart controller over WiFi and feeds live stick/wheel input into the sim.

Controller support: DJI Mini 3 controller (and other DJI RC smart controllers) over WiFi. See tools/dji-rc-bridge for the list of confirmed/likely-compatible hardware.

Drone Flight Trainer — a DJI Mini 3 flying a white-box practice course, with the live DJI RC telemetry HUD showing a connected controller and real-time stick/wheel axes

Flying a practice course with live input from a connected DJI RC — the HUD shows the controller link and real-time stick/wheel values.

This project began as a mashup of two existing open-source projects and has since diverged substantially into its own thing — see Credits.

Repository layout

.
├── Assets/                 Unity project — scenes, scripts, models, audio, UI
├── Packages/               Unity package manifest
├── ProjectSettings/        Unity project settings
├── UserSettings/           Per-user Unity editor state (git-ignored)
├── plot_log.m              MATLAB/Octave script for plotting flight logs
└── tools/
    └── dji-rc-bridge/      Native DJI RC controller driver + verification tool

This is a single Unity project at the repository root. Open the root folder in Unity to load it.

Requirements

  • Unity 6000.5.0f1 (Unity 6.1) — pinned in ProjectSettings/ProjectVersion.txt.
  • A DJI RC smart controller on the same WiFi network (for real-controller input).

Running the simulator

  1. Open this folder as a project in Unity Hub / Unity Editor.
  2. Open Assets/_Scenes/MainScene.unity.
  3. Press Play.

Key in-sim controls (see Assets/Scripts/ for the authoritative bindings):

  • C — cycle cameras (FPV / follow / eye-level / gimbal)
  • G — toggle gimbal camera horizon-lock vs. FPV mode
  • M — switch maps (maps load additively via MapManager)
  • Gimbal camera: left wheel tilts, right wheel zooms

Gimbal & camera training

The sim models the drone's gimbal mechanics and includes a dedicated gimbal camera so you can practice more than just flying the airframe. The gimbal tilts up and down and the lens zooms in real time — driven by the controller wheels (left wheel = gimbal tilt, right wheel = zoom) — so you can rehearse cinematic passes where you fly a line while simultaneously craning the gimbal up/down and pushing or pulling zoom, building the coordination those moves need before attempting them on the real aircraft.

Controller input

Two independent paths read the DJI RC:

  • In-engine (default): Assets/Scripts/DjiRcInput.cs opens a direct TCP connection to the controller. Point it at the controller by setting either the KESTREL_DJI_RC_IP environment variable or the djiRcIp PlayerPrefs key to the controller's IP address.

  • Native bridge / verification: tools/dji-rc-bridge is a standalone C/Obj-C driver. Use it to confirm the controller is reachable and decoding correctly before launching the sim, e.g.:

    cd tools/dji-rc-bridge
    mkdir build && cd build && cmake .. && cmake --build .
    ./dji-rc-joystick -t      # test mode: print live stick/button values

    On Linux it can also expose the controller as a virtual joystick via uinput; on macOS it builds a virtual-gamepad target. See the tool's own README for full options and the input map.

Credits / prior work

This repo is a heavily modified combination of two upstream projects. Their git histories were intentionally not carried over — the code here has diverged enough to be effectively a new project — but full credit goes to the originals:

Asset attribution

Source code is MIT (below). Bundled art assets are licensed separately:

License

MIT — see LICENSE, which carries the copyright of the three upstream sources (KestrelFPV, dji-rc-linux, and this project). The MIT terms cover the source code; bundled art assets are covered by their own licenses (see Asset attribution above). The bundled controller bridge retains its own MIT license at tools/dji-rc-bridge/LICENSE.

About

A Unity flight simulator for practicing drone control with a real DJI RC smart controller over WiFi — build muscle memory before you fly. Includes a native DJI RC bridge and multiple maps.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages