How lokestrom/drone_piloting works
Drone Piloting is an interactive drone-flight simulator. The principal workflow is: the user launches the application, provides keyboard/gamepad input, the simulation updates player and drone state through PID control, and the renderer presents the resulting scene and UI. Startup also loads a drone and map asynchronously; menus can request replacements. The excerpts directly establish application-loop orchestration, input handling, PID control, asynchronous work, ImGui UI, and Vulkan/GLFW integration. Several model and loading call paths are inferred only at subsystem level because their implementations were not sampled.
Main entry points: App.cpp Application Loop · asyncWorker.cpp Async Worker · Player.cpp Player State · importJSONData.cpp Asset Import
Components 18
Runtime Orchestration
- Application Loop
src/App.cpp - Input Handling
src/Input/InputEventHandler.hpp
Flight Simulation
- Player State
src/Player.cpp - PID Controller
src/API/helpers/PIDcontroller.hpp - Drone API
src/API/DroneAPI.h - Drone Model
src/Drone.cpp - Map Model
src/Map.cpp
UI And Loading
- Async Worker
src/structures/asyncWorker.cpp - Asset Import
src/importJSONData.cpp - GUI Application
src/gui/guiApp.cpp - Selection Windows
src/windows - Settings UI
src/gui/settingsGui.cpp - Worker Status UI
src/gui/asyncWorkerGui.cpp
Rendering
- Renderer Setup
src/rendererSetup.cpp - Vulkan Renderer
Other components
- Pilot
- GLFW Window
- Vulkan Runtime
Connections 23
- Pilot → Application Loop: launches
- Pilot → Input Handling: provides input
- Application Loop → GLFW Window: polls events
- Application Loop → Input Handling: resets input
- Application Loop → Player State: updates players
- Input Handling → PID Controller: drives targets
- Player State → PID Controller: updates controller
- PID Controller → Drone API: writes commands
- Player State → Drone Model: updates state
- Application Loop → Async Worker: submits loading
- Async Worker → Asset Import: runs import
- Asset Import → Drone Model: loads drone
- Asset Import → Map Model: loads map
- Async Worker → Worker Status UI: reports status
- Application Loop → GUI Application: generates windows
- GUI Application → Selection Windows: dispatches views
- GUI Application → Settings UI: renders settings
- Selection Windows → Async Worker: requests loading
- Application Loop → Renderer Setup: configures renderer
- Application Loop → Vulkan Renderer: renders frame
- Renderer Setup → Vulkan Runtime: initializes Vulkan
- Renderer Setup → GLFW Window: creates window
- Vulkan Renderer → Vulkan Runtime: submits drawing