Case study 03 · Bachelor's thesis · 2025
A drone that follows the car in front of it
A DJI Ryze Tello detects a target car with YOLOv8, works out whether it sees the car's left, right or back, and moves to stay behind it.
- left/right orientation correct at 2–3 m (20 of 20 each)
- 100%
- working detection range
- 4 m
- mAP50 after 150 epochs
- 0.994

My bachelor’s thesis started with last-mile delivery, the stretch from a distribution centre to the customer’s door. Delivery vehicles that burn fossil fuel are a large part of transport emissions, and small drones are one of the ideas for that last stretch. One way to run them is leader-follower: a drone that follows a vehicle instead of flying its own route. Before a drone can deliver anything that way, it has to do something simpler: see the vehicle, know which side of it is in view, and move until it is behind it. That is what I built and tested, with a toy car as the target in a controlled indoor setting.
The problem
Detecting a car in a frame is well understood. Knowing where to fly next is not, because a box around a car does not say which way the car is facing. If the drone sees the car’s left side, it is beside the car and needs to reposition. So the system has to classify orientation, not just presence, and turn that class into a movement.
It also has to happen fast enough to matter. The drone streams video over Wi-Fi, a computer runs detection, and commands go back to the drone. Every delay in that loop shows up in the air.
My role
I built it alone as my final project in Computer Engineering at Institut Teknologi Sepuluh Nopember, supervised by two lecturers: data collection, labelling, training, the tracking logic and the tests.
What I built
- Data. I recorded video with the drone’s own camera from many angles, saving one image every five frames, then labelled the images in Roboflow with three classes: car left, car behind and car right. Roboflow augmentation (crops, saturation and exposure changes) tripled each training image, and YOLOv8 added its own augmentation during training.
- Model. YOLOv8n, the nano model, chosen because it runs well on modest hardware. About 2,100 images, 150 epochs, batch size 16, 640 × 640 input, trained with CUDA on a GTX 1660 Ti.
- Detection. Frames of 640 × 480 arrive from the Tello over Wi-Fi through the djitellopy library, and each one is passed to the model with a confidence threshold of 0.3.
- Tracking. The centre of the box is compared with the centre of the frame to tell whether the car is too far left, right, up or down. If the model sees the car’s left side, the drone moves right, advances and turns 90° counter-clockwise; for the right side it does the mirror image, so it ends up behind the car with the car still in view.
The numbers
- 0.994 mAP50 after 150 epochs, with precision 0.995 and recall 0.996.
- 100% correct left and right classification at 2 m and 3 m (20 of 20 each), falling to 90% and 85% at 4 m. At 5 m detection was no longer reliable, so 4 m is the working range.
- About 2.0 s average response for a 20 cm sideways move, and about 1.3 s for a 30° turn.
- 8–10 minutes of flight while tracking, down from the 13 minutes the maker specifies, because of continuous video streaming.
What I learned
The training scores were nearly perfect, and the drone still overshot. The control is open-loop, so the drone moves quickly while YOLOv8 inference runs slower, and the two drift out of step. That gap between a model’s benchmark and a system’s behaviour is the most useful thing the thesis taught me: autonomy is a balance of speed, accuracy and stability, and the weakest link sets the result.
I also learned to report limits honestly. The tests were indoors, with controlled light and a toy car. Outdoors, with changing light and busy backgrounds, accuracy would drop, and when the car leaves the frame for long, tracking needs one to two seconds to recover. Writing those down made the results more believable, not less.
The same thread runs through my later work: software that has to work off the screen, where the real world tells you quickly when you are wrong.
