Repository of all documentation for and code used on Dronehook.
Dronehook is an autonomous fixed-wing UAV designed to grab packages from a designated station mid-flight. We are designing it to combine the long-range advantage of fixed-wing flight with the reliability, scalability, and speed of an autonomous system. Much of the project has been resolving compatibility and install issues, which will all be documented here.
Our Ground Control Station (GCS) is a Dell XPS 13 laptop running Ubuntu 18.04. We tried to use both 22.04 and 20.04 but ran into issues in both versions when downloading Ardupilot SITL, which is software that allows us to simulate our plane's flight controller and send it commands to determine if the control code we are writing functions as intended.
Our code is written in Python but we are considering refactoring it to C++ if we think there will be significant performance increases. We use Python 3.6.9 with OpenCV 4.6.0 installed on a NVIDIA Jetson Nano. We attached a CSI camera (Raspberry Pi HQ Camera v1.0 -- IMX477 sensor) directly to the Jetson and used the jetson-io.py installed on the Jetson to switch the camera driver from IMX219 to IMX477. Any IMX477 or IMX219 sensor should work so long as the correct one is selected via the jetson-io.py script. The example code found here worked for us in the CLI to start up the camera. The code uses the gstreamer plugin to control the camera. In code, this looks like a gstreamer pipeline string plugged into an OpenCV VideoCapture instead of cv2.VideoCapture(1). OpenCV 3.2.0 does not come with gstreamer support. gstreamer is important for a high-framerate, low-latency video stream, but is more complicated than OpenCV's built-in camera stream. gstreamer pipelines tend to be trial and error and ours seems to work well enough for our purposes.
We use the pymavlink library to send messages to the autopilot via mavlink. This set of YouTube videos has been a tremendous guide for surviving the pymavlink docs. The videos cover a takeoff command which did not work for me, and my knowledge of the library is not thorough enough to really troubleshoot it. As a result, we change into the ArduPilot Takeoff flight mode and the autopilot takes off from there.