UmarlyPoeta/dual_tech_konkurs_kod
This project implements a reconnaissance system for an unmanned ground vehicle (UGV) running on Raspberry Pi. It supports both manual and autonomous driving modes, using a camera, GPS, QR code recognition, and an AI model (YOLOv8) to detect and classify military and civilian objects.
Dual-Tech UGV Drony Na Odlew
Overview
This project implements a reconnaissance system for an unmanned ground vehicle (UGV) running on Raspberry Pi. It supports both manual and autonomous driving modes, using a camera, GPS, QR code recognition, and an AI model (YOLOv8) to detect and classify military and civilian objects.
Main features:
- Real-time keyboard control
- Movement tracking and route replay
- QR code and associated image recognition
- YOLO-based object detection and classification
- Automated mission report generation
Directory Structure
umarlypoeta-dual_tech_konkurs_kod/
├── main.py / main2.py # Basic control scripts
├── vehicle_control_server.py # Flask server for remote control
├── start_server.sh # Script to launch the server
├── raport.txt / raport_misji.txt # Example reports
├── architektura/ # Legacy modules
│ ├── camera.py, engine.py, gps.py, start.py
└── wersja_nowa/ # Final implementation
├── main_ost.py # Final version with threading & AI
├── main2_auto*.py # Alternative auto-driving scripts
├── create_file.py # Mission report generator
├── robienie_zdjec*.py # Image dataset creation scripts
└── ai/
└── categorize.py # ONNX model image categorizer
Requirements
- Raspberry Pi (tested on Pi 5)
- Python 3.7+
- Dependencies:
pip3 install flask RPi.GPIO gpiozero opencv-python pyzbar picamera2 onnxruntime numpy- Compatible camera (Picamera2)
- GPS module (connected via UART)
- Trained YOLOv8 model (
best.onnx)
Usage
Manual & Auto Modes
Run the main script:
python3 wersja_nowa/main_ost.pyManual Mode Controls:
| Key | Action |
|---|---|
| w | Move forward |
| s | Move backward |
| a | Turn left |
| d | Turn right |
| x | Stop |
| m | Save route |
| t | Switch to auto mode |
| q | Quit |
In Auto Mode, the UGV replays the saved movement path from track_log.json.
Features
✅ QR Code Recognition
- Scans and logs QR codes using Pyzbar
- Extracts and compares images located beneath QR codes via OpenCV
✅ GPS Integration
- Retrieves and logs real-time coordinates
- GPS logs are included in all object and QR detections
✅ Object Detection (YOLOv8)
- Detects predefined object types using
best.onnx - Detected objects are classified and saved in
rozpoznane_obiekty.txt
✅ Mission Report Generation
Run:
python3 wersja_nowa/create_file.pyIt generates raport_misji.txt including:
- Team name
- Recognized objects
- Traversed and optimal paths
- Length of optimal route
Dataset Creation for Training
Run:
python3 wersja_nowa/robienie_zdjec3.py- Captures images from the camera
- Saves them into YOLO-compatible folder structure
- Generates empty label files for annotation
Offline Image Categorization
Run:
python3 wersja_nowa/ai/categorize.py- Processes all images in
images/ - Classifies each using the ONNX model
- Saves results to
results.txt
Author
umarlypoeta
Entry for Dual-Tech Challenge
📅 April 2025

