DRAFTFIG. DRONE-GCS-01
UNDER DEVELOPMENTRust + TokioTauri v2 DesktopMAVLink v2ArcSwap Lock-Free
WebRTC MediaMTX (<300ms)PMTiles Offline Map (60 FPS)<220 MB RAM

KESTREL - UAV Flight Control

1. the problem

Legacy ground control stations (such as QGroundControl and Mission Planner) run monolithic Qt/C++ or 1.2 GB Electron runtimes where 1080p video decoding, high-rate telemetry, and vector maps share process threads. A video stall or garbage-collection pause during landing can freeze vehicle telemetry: decoupling flight-critical MAVLink communications from presentation via a 4-tier process topology in Rust and Tauri v2.

INTERACTIVE PIPELINESWIPE ⇄
async transportserial / ftdiudp 14550 / tcptier 1: transportrust systems corecrc-16 verificationheartbeat supervisorarc-swap state cachetier 2: rust core50 hz binary ipcflat binary ring bufferzero-copy float arraytauri-specta typed rpctier 3: ipc bridgeTAURIDeck.glWebRTCtier 4: ui
STAGE 01 // Physical Transport Ingestion

ROLE: Non-blocking serial (FTDI/CP210x), UDP (14550), and TCP (5760) asynchronous workers running on dedicated Tokio runtime threads.

// Non-blocking asynchronous serial transport loop let mut port = tokio_serial::new(&port_path, baud_rate).open_native_async()?; let mut buf = vec![0u8; 4096]; loop { let n = port.read(&mut buf).await?; if n > 0 { framing_tx.send(Bytes::copy_from_slice(&buf[..n])).await?; } }
INVARIANT: Zero serial baud rate stalls: Transport I/O decoupled from parser queue.
FAILURE GUARD: Watchdog supervisor triggers auto-reconnect with exponential backoff on USB drop.

2. what i built

High-reliability UAV ground control systems architecture in Rust, Tokio, and Tauri v2:

Rust + Tokio async transport loop
MAVLink v2 CRC-16 validator
ArcSwap lock-free state cache
50 Hz packed binary ring buffer
Tauri v2 native webview shell
MediaMTX WebRTC video sidecar
PMTiles 60 FPS offline vector map
PX4 & ArduPilot mode normalizer
Backend-enforced arming safety gates
2.5s command ack watchdog timeout
Dockerized SITL simulation tests
Sub-220 MB RAM active footprint

3. problems i had to crack

Click card to view root cause & code diff
A50 hz json bridge saturation
▼ DIFF

Legacy Electron and Qt GCS architectures serialize full JSON trees across IPC at 50 Hz, triggering severe garbage-collection pauses (60-120 ms) and UI micro-stutters during landing. Fix: Replaced JSON IPC with a packed flat-binary float buffer streamed into a lock-free ring buffer.

Bvideo decode telemetry starvation
▼ DIFF

In monolithic GCS apps, 1080p H.264 video decoding stalls the main process thread, delaying safety-critical heartbeat processing and triggering false Failsafe RTL triggers. Fix: Isolated video into an independent MediaMTX sidecar communicating via local WHEP/WebRTC.

Cpx4 vs ardupilot mode divergence
▼ DIFF

PX4 and ArduPilot encode flight modes into conflicting custom mode bits inside MAVLink heartbeat packets, causing erratic mode switches when switching drones. Fix: Built a normalized Rust abstraction layer mapping raw bitmasks into canonical FlightMode states.

Dcommand replay on link recovery
▼ DIFF

When RF or USB telemetry drops mid-flight, naive command queues buffer takeoff or arm commands and replay them upon reconnection, causing hazardous unexpected vehicle reactions. Fix: Implemented a 2-phase verification engine with 2.5s watchdog timeouts and zero command replay.

FLIGHT SYSTEMS ARCHITECTURE. Verified via Dockerized PX4 & ArduPilot SITL simulation environments.

PROJECTKESTREL // GCS
DRAWN BYBIDYA B. NANDA
STATUSUNDER DEVELOPMENT // FLIGHT SYSTEMS