
Shanghai University Students' Engineering Practice and Innovation Competition · delivery drone track
The arena is 4 × 4 m, with the launch pad and three drop zones A, B and C in the corners. Zone A is a 500 mm target ring, scored by how far the payload lands from the centre; B and C carry different patterns that have to be recognised before releasing. A building stands between the start and zone A, and there are lamp posts on the B–C line — obstacles and pattern order are drawn on site, and the posts can shift by ±500 mm, precisely to defeat open-loop scripts that just follow a timer.
The payload is a cone with a spherical cap: 60 mm cap diameter, 50 mm base, 65 mm tall (70 mm limit). Compared with a cylinder it sits lower, tips less on landing and is less sensitive to rotor wash.
The flow is simple: load and secure → a single start command begins the clock → drop at A, B and C in order, one attempt each → B and C require crossing obstacles → after C, return and land to stop the clock.
Scoring details that shape the strategy: +5 per obstacle correctly crossed; +3 for returning inside the time limit; the payload must land upright or it does not count; a coefficient rewards autonomy; each team flies two rounds of five minutes, weighted 50% each with the best kept; a 20-second stop ends the round, and touching the safety net or an obstacle ends the run outright.

The aircraft carries a PX4 flight controller and a Jetson Nano. The Nano does three jobs: MAVROS for talking to the flight controller, the RealSense T265 VIO pipeline (through vision_to_mavros into the EKF), and the downward CSI camera for pattern recognition. The ground station is a second Ubuntu machine running the mission program. The two talk over ROS networking, which means ROS_MASTER_URI, ROS_IP and /etc/hosts all have to agree before take-off — and when they do not, the symptom is “the aircraft flies but ignores commands”, which is why Chapter 1 of our operating manual is entirely about networking.
That is also how the work was split: flight control and mission flow, vision, and structure/release mechanism, four lines meeting in the same launch file.

com_node is the mission program. Given a list of waypoints, it repeats the same block for each one:
for (int i = 0; i < num_fly + 1; i++) {
fly_high(i, desire_z); // from 0.3 m, step up to cruise altitude
fly_to(i); // approach the waypoint, arrived when all three axes are within 0.15 m
landing(); // step down, landed when |vz| < 0.1 m/s and altitude < 0.1 m
unload(i + 1); // below 0.2 m: hold 3 s, send /servo, hold 2 s more
}
Four calls, but every one of them hides the same rule: setpoints have to be walked over, never jumped.
void add_target(int i) {
for (int j = 0; j < 3; j++) {
if (abs(next_point[j] - fly_point[i + 1][j]) > 0.3) {
if (next_point[j] > fly_point[i + 1][j]) {
next_point[j] -= change;
} else {
next_point[j] += change;
}
} else {
next_point[j] = fly_point[i + 1][j];
}
}
}
With change between 0.02 and 0.05 m and the loop running at 20 Hz, the aircraft sees a smooth trajectory instead of a step input. Publishing the destination directly makes the controller fight the frame to catch up. This is the least glamorous line in the project and the one that decides whether the aircraft looks calm on video.
You have five seconds after arming to enter OFFBOARD. If PX4 does not receive external setpoints shortly after arming, it re-arms itself and the aircraft never leaves the ground. The on-site sequence was fixed accordingly: switch to OFFBOARD first, then arm — and never use AUTO.TAKEOFF.
send_info_node is a 20 Hz safety net. Whatever the mission is doing, if the aircraft is not yet in OFFBOARD or not armed, this node keeps publishing setpoints. Without it, the instant of switching modes manually is enough for the controller to decide it has no external command and drop out of the mode.
The landing target height is negative. landing() drives the setpoint z down to −0.5 m, below the floor. The aircraft cannot go there, so it keeps pushing down until speed and altitude fall under the thresholds. A hack, but a reliable one.
The release itself is even cruder: wait until altitude is below 0.2 m, hold position for 3 seconds so the airframe and payload settle, send one byte to the Arduino, then hold 2 seconds more so the aircraft does not climb away and drag the payload with it.
The cargo bay is fully enclosed: four acrylic rods and two outer rings, heavily perforated to save weight. Each bay has its own servo whose arm presses the payload against the frame so it stays still in flight; on command the arm rotates, the payload drops vertically, and the bay keeps flying and can be reused.

The Nano-to-Arduino link is a single-byte serial protocol: 1 / 2 / 3 open the corresponding bay, 6 resets all of them, anything else is ignored, at 9600 baud. The device is pinned to /dev/arduino through a udev alias, otherwise every replug moves it between ttyACM0 and ttyACM1 — a reconfiguration you only want to do once.
The downward camera runs at 960 × 540 and the detector is pure contour geometry, not template matching. The test is a single dimensionless ratio, perimeter² over area:
Pre-processing is bilateral filtering → Canny(24, 144) → a 9 × 9 closing to bridge broken edges → a 3 × 3 opening to kill highlights, then findContours filtered by the test above. The centroid comes from the contour moments, the pixel offset (480 − x, 270 − y) is converted into metres with a pinhole model, and that offset nudges the drop point.
The advantage is weight: it runs on a Nano and needs no training. The disadvantage is recorded in the known issues below.
First prize at the university qualifier (October 2022) and the Grand Prize at the municipal final (December 2022).
What decided the run was not how steadily the aircraft flew but how many of the three drops landed upright. The final version flew blind to the waypoint, applied one visual correction, then landed and settled before releasing — so the residual error came mostly from T265 drift rather than from recognition accuracy.
In the same semester we used the system as the group project of a French-taught project management course: Gantt chart, four decks on risk, resources, scheduling and communication, a survey, a promo video and a full set of weekly plans. Sharing one set of material between the technical and the PM project was the best value decision of that year.
The archived code is left exactly as it ran; the problems are documented rather than fixed:
fx = 4.476, fy = 5.96 and the sensor size were calibrated for that one CSI camera — changing the camera requires recalibration;desire_z (cruise altitude) takes five different values across the launch files — 0.5 / 1.0 / 1.4 / 2.0 / 5.0 m — and you must check which one is live before flying;landing_quadrotor.cpp, take_off_test.cpp and fly.cpp are half-finished: they depend on a message type that does not exist, or do not compile. Do not roslaunch them.The rules, the task statement, the operating manual, the complete ROS workspace and 14 debugging recordings (seven of them public in the release) are in the repository:
https://github.com/yicongl1/Drone-Delivery-2022
The archive was reorganised into six levels — competition material, technical documents, code, recordings, project management course, miscellany — compressing 630 files and 4.7 GB down to 391 files and 4.5 GB. Git tracks only 312 files (about 295 MB); the recordings live in the release. Teammate names were replaced with neutral placeholders throughout.