An autonomous ground robot that finds every shuttlecock scattered across a badminton court, works out the shortest route to reach them, and collects them — so players don't have to. This project combines instance-segmentation detection, camera-to-world coordinate transforms, and a greedy TSP traversal strategy that outperforms standard path-planning baselines on this task.
After a badminton training session, dozens of shuttlecocks end up scattered across the court and have to be picked up by hand. This project builds a mobile robot that automates that job: an onboard camera detects shuttles, a coordinate transform maps each detection onto real-world court coordinates, and a path planner sequences them into a route the robot can actually drive — before a particle-filter localization and pure-pursuit control stack executes it.
Shuttle detections flow from image coordinates to court coordinates to a collection path, which a particle filter and differential-drive controller then execute in closed loop with LiDAR and odometry feedback.
prediction.py runs sliding-window instance segmentation with a customized
Mask R-CNN model (Detectron2, trained in training.py on data labeled with
Label Studio) to locate shuttlecocks in a raw frame. coordinate_transform.py
then uses a calibrated camera matrix plus an optimized roll/yaw/displacement transform to
project each detection from image pixels onto a flat, real-world court coordinate system.
Once the robot sweeps through a region of the court, every shuttle inside it is collected — so the court is discretized into square cells the width of the collector, and connected cells are grouped into clusters. A fully-connected graph of clusters is built from inter-cluster distances, and the visiting order is chosen by solving a Travelling Salesman Problem over that graph. Within each cluster, a second TSP orders the individual shuttles, and the results are stitched into one overall path.
A particle filter fuses wheel odometry with LiDAR returns off the court's boundary poles to keep the robot localized, while a pure-pursuit controller follows the planned path by steering toward a lookahead point along it. Both were validated in a Gazebo simulation of the court before running on hardware.
The full stack — detection, coordinate transform, path planning, localization, and control — running on hardware on a real court.
Shuttle patterns were randomly scattered on the court and photographed; the same pattern was replayed for each path-planning algorithm so results are directly comparable. Distance travelled and time spent were logged by the robot, and accuracy is the percentage of shuttles actually collected by the end of the run.
| Path model | Distance travelled (m) | Time spent (s) | Accuracy |
|---|---|---|---|
| Greedy TSP | 8.89 | 49 | 100% |
| Standard TSP | 9.03 | 48 | 92.3% |
| Nearest Neighbor | 9.50 | 55 | 100% |
| Ox Turn | 25.03 | 134 | 100% |
The greedy TSP algorithm matches standard TSP's distance and time while avoiding its shuttle losses from frequent large-angle turns, and it clearly outperforms simpler Nearest Neighbor and Ox Turn (sweep coverage) baselines on this collection task.
The pipeline can be run end-to-end via pipeline.py, which chains detection, coordinate transform, and traversal planning on a test image.
prediction.py Mask R-CNN sliding-window detection (Detectron2) training.py Trains the shuttle-detection model coordinate_transform.py Camera calibration + image-to-court coordinate transform pipeline.py End-to-end: detect → transform → plan traveral_algorithm.py Combines traversal strategies into one pipeline path_planning.py Grid discretization & connected-component clustering k-mean_clustering.py K-means clustering of shuttle positions minimum_cost_flow.py Weighted balanced clustering via min-cost flow integer_linear_programming.py ILP / TSP route optimization spine_tree_cluster_traversal.py Tree-based cluster traversal heuristic state_space.py Robot pose belief & target-visibility model Images/, Labels/, datasets/ Training data, annotations, and captured test imagery logs/ Training run configs, metrics, and checkpoints