MQ-9 flight cockpit
Real-time flight control and cockpit written in Rust, on a Raspberry Pi: inertial sensor, PID servo stabilisation, map, mission and weather, in the browser.
Screenshot of the running cockpit, with the real sensor connected- Language
- 100 % Rust
- Sensor loop period
- 50 ms
- Flight modes
- 6
- Embedded target
- Raspberry Pi
From sensor to screen
Sensors and stabilisation
MPU-6050 inertial unit read over I2C, complementary gyroscope/accelerometer filter, PID controller driving the roll and pitch servos.
Real-time cockpit
Web interface served by the Pi and updated over WebSocket — artificial horizon, 3D model, map, mission, radio link, battery — or a native window on the Pi’s screen.
Mission and environment
Six flight modes, waypoint planner on the map, live local weather and MQTT messages to talk to other equipment.
The project
The MQ-9 flight cockpit is the electronics and software side of the drone. An onboard Raspberry Pi reads the inertial unit, stabilises the aircraft by driving its control surfaces and streams the full flight state to a cockpit that opens in any browser.
What sets it apart
- Written in Rust: the language’s memory safety applied to real-time code that controls an aircraft in flight.
- Real hardware: the cockpit shows measurements from the connected sensor, not a simulation.
- Built-in stabilisation: complementary filter and PID controller, with an automatic mode and trims adjustable from the interface.
- A single binary: sensors, control, web server, MQTT and weather all run in the same program, on the Pi.
- Tested: unit tests on sensor reading and control.
Status
In progress. The cockpit and the sensor chain work on the bench; next step, integrating the servos and GPS into the 3D-printed airframe.