I propose to use a flight controller (FC software like [Betaflight][1]) connected to an Arduino or Raspberry Pi.

The new F3 or F4 flight controllers have, in general, I2C/SPI interfaces where you can call the FC functions.  


  [1]: https://github.com/betaflight/betaflight/releases