simondlevy/Hackflight

Minimalist flight-control toolkit for makers

What it solves

Hackflight addresses the complexity of flight-control firmware by providing a minimalist, composable toolkit for building multirotor controllers and simulators. It is designed for people who want to experiment with the internals of state estimation and PID control, or teach those concepts, without wading through thousands of lines of production flight code.

How it works

Hackflight keeps a direct mapping between its code and the classic flight-control dataflow: boxes are data, ovals are functions, and feedback arrows represent stateful functions like PID error integrals. It uses header-only C++ classes, avoids macros, null pointers, inheritance, and mutation, and prefers functional style. It relies on existing Arduino libraries for sensors and actuators, so you can compose the pieces you need. The entire codebase is under 3,000 lines.

Who it’s for

Hackflight is for hobbyists, students, and educators who want to tinker with the firmware side of multirotor flight. It is not meant for the 99% of users who just want a working vehicle—those should use Betaflight, ArduPilot, or Crazyflie, which also offer safety features Hackflight lacks.

Highlights

  • Under 3,000 lines of C++ code—easy to read and modify.
  • Header-only implementation reduces build and integration friction.
  • Uses functional-style programming for clarity and composability.
  • Pairs with Webots, a free open-source robotics simulator, for safe testing.
  • Specific hardware support (Teensy4.0, BMI088 IMU, ESP32-based receiver/transmitter) is documented.

Related

  • Project
  • Project
  • Project
  • Project