Complete System Workflow
Pre-flight Setup:
The mission is planned using QGroundControl, including GPS waypoints for takeoff, flight, payload drop, and landing.
Components (Pixhawk 4, Raspberry Pi 5, Arducam camera, servo-controlled payload bay) are mounted and tested.
Since the avionics bay on the Apprentice is under the wing, that meant we had to detach and reattach the wing everytime we wanted to access the avionics. The wing is joined to the fuselage only using rubber bands.
Autonomous Flight:
The Pixhawk autonomously controls the plane to take off and fly along GPS waypoints, ensuring stable navigation.
Vision-Based Target Detection:
The camera captures live video at 1 frame per second as the aircraft approaches the drop zone.
OpenCV processes frames using HSV filters to detect the red tarp, isolating it with contour detection and centroid calculations.
Payload Drop:
The Raspberry Pi calculates the optimal release point using the target’s position and the plane’s speed/altitude.
The servo opens the payload bay, releasing the payload accurately onto the tarp.
Post-Drop and Landing:
The camera verifies successful drop placement.
The Pixhawk guides the plane to the landing zone for autonomous landing.
Data Logging:
Flight and vision data are logged for performance analysis.
Custom Software
We wrote a script to quickly flip through footage frames after flights to accelerate the HSV tuning process in three steps:
Firstly, we implemented dynamic HSV threshold tuning which included interactive trackbars for adjusting HSV ranges in real-time to detect the desired color range for object detection.
Next, openCV processes the image to create a binary mask where pixels within the HSV range appear white while others are black. The binary mask is analyzed to detect contours using openCV’s inbuilt contour detector. The area is calculated using cv2.contourArea and only contours within the defined area are considered valid.
Once the object has been identified, the frame is overlaid with rectangles around valid contours using cv2.boundingRect and the original image, mask, and resulting image with the bounding boxes are displayed.
Flight recording in our HSV tuner
QGroundControl autopilot flight path planner
Airborne tarp detection photo in our HSV tuner
Detection pipeline testing (with inverted colors)
Electronics Housing Unit
Pixhawk Case:
Ensures that the Pixhawk unit remains in place during flight and is contained as a single unit with the Raspberry Pi. We wanted all of our computational electronics to be packaged in a single unit. The Pixhawk is easily removable and slides out of its housing.
Raspberry Pi Mount:
The Raspberry Pi mount ensures that the Pi remains in place attached to the PM07 Power distribution board and the Pixhawk during flight. The power distribution board is what powers the Pixhawk and control surface servos.
Custom Spacer
To prevent any magnetic interference from affecting the Pixhawk and to ensure that we can easily access the ports on the PM07 Power distribution board and the Pixhawk, we designed a spacer that provides some clearance between the power distribution board and the Pixhawk.
Custom Spacer
Pixhawk case
Raspberry Pi Mount
Adjustable Camera Mount
Camera Housing
Plane Mount
Camera Housing Unit
Adjustable Mount
During our project we weren't sure what angle we wanted our camera to be mounted at so we decided that having an adjustable mount would have been best in case certain viewing angles proved to better than others.
Camera Housing
Because our camera would be mounted to the bottom of our plane, it was highly likely it would suffer from impact as a result of "rougher" landings. To protect our camera we designed a camera housing which exposed only the lens and had a port in the back for the 4-pin connector that goes to the Raspberry PI
Payload Bay
Servo Housing
Our design uses a 20kg servo which needed to be held in place on the bottom of our plane. Our system is designed to the tolerances of the Coleman portable first aid kit, ensuring no accidental drops.
Servo Arm
In order to hold our payload in, a small arm was designed to attach to the horn of the servo and hold the payload in place.
When the servo rotates 90 degrees, the payload is free to drop from the bottom of our plane purely from gravity.
Servo Arm
Complete Servo and Payload Housing