This project enables autonomous drone navigation and precision landing using GPS waypoints and QR code detection for enhanced accuracy. The drone takes off, navigates to a specified location, scans for a QR code, and lands precisely on it.
✅ Autonomous takeoff and navigation to a GPS waypoint
✅ Real-time QR code detection for precision landing
✅ Uses DroneKit-Python for drone control
✅ Vision-based final landing using OpenCV
✅ Threaded QR scanning for real-time detection
│── README.md
│── pyproject.toml
│── uv.lock
│── .python-version
│
├── src/
│ ├── main.py # Main entry point of the application
│ ├── config.py # Configuration settings
│ ├── qr_detector.py # QR code detection logic
│ ├── drone_control.py # Core drone control functions (e.g., takeoff, landing)
│ ├── drone_utils.py # Utility functions (e.g., distance calculation)
Python 3.12
dronekit
for drone communicationopencv-python
for QR detection
- Clone the repository:
git clone https://github.com/haroon0x/drone-qr-detection.git cd drone-qr-detection
- Install dependencies using
uv
:pip install uv uv pip install
- Connect to the drone:
python src/main.py --connect 127.0.0.1:14550
For a real drone, replace 127.0.0.1:14550
with your actual telemetry connection string.
- Start the script:
python main.py --connect 127.0.0.1:14550
- The drone will:
- Take off
- Navigate to the specified GPS location
- Scan for a QR code
- Land precisely on the QR code
- Arms the drone and ascends to the given altitude
- Moves the drone to the given GPS coordinates
- Runs a separate thread for QR code detection
- Calls
callback(data)
when a QR is detected
- Handles QR detection and initiates landing
- Built using DroneKit and OpenCV.
- Inspired by precision landing research in autonomous drones