Autopilot
Platform
Ease of development dictated the choice to run the control loop on existing hard- and software. which was chosen to be Ardupilot running on a Beaglebone blue.
Setup
For the beagle bone setup follow this tutorial. The versions of Debian and Ardupilot used in this tutorial are old. The Debian image used on the beaglebone is the 10.13 eMMC flasher. The procedure to flash Debian to the onboard eMMC can be found here. Also make sure to use version 4.3.1 of ardupilot by using the command bellow during the Ardupilot tutorial.
sudo wget -O /usr/bin/ardupilot/arduplane https://firmware.ardupilot.org/Plane/stable-4.3.1/blue/arduplane
Relevant links for configuring Ardupilot
https://ardupilot.org/copter/docs/common-gcs-only-operation.html
https://ardupilot.org/copter/docs/common-rangefinder-landingpage.html
https://ardupilot.org/copter/docs/setting-up-for-tuning.html
https://ardupilot.org/copter/docs/terrain-following-manual-modes.html
https://ardupilot.org/copter/docs/common-sensor-offset-compensation.html
https://ardupilot.org/copter/docs/crash_check.html
https://ardupilot.org/copter/docs/flight-modes.html --Stabalize mode seems best fit
https://ardupilot.org/copter/docs/stabilize-mode.html
https://ardupilot.org/plane/docs/fixed-wing-faq.html --Disable Gyro calibration on start-up
https://ardupilot.org/rover/docs/sonar-sensors.html --Two sonar sensors
https://ardupilot.org/dev/docs/plane-architecture.html --Plane architecture and files