Skip to content

koesan/Python_Dronekit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python DroneKit Projects

Two autonomous drone projects: AI-powered fire detection & Vision-guided precision landing

Python ROS DroneKit YOLOv4 OpenCV Gazebo

🔥 Fire Detection Drone

yolo_dronkit_yangin_tespit.mp4

🎯 Precision Landing Drone

opencv-dronekit.mp4

English | Türkçe


English

🚁 What's Inside?

This repository contains two autonomous drone projects built with DroneKit and computer vision. Both run in ROS Gazebo simulation and demonstrate different real-world applications of drone autonomy.


🔥 Project 1: Fire Detection Drone

Autonomous fire detection system using YOLOv4 deep learning

What it does:

  • Flies autonomously at set altitude
  • Processes live camera feed with YOLOv4
  • Detects fires in real-time
  • Shows visual alerts with bounding boxes
  • Continues patrol mission while monitoring

Key Features:

  • 🔥 Real-time Fire Detection - YOLOv4 trained model for fire recognition
  • 🤖 Autonomous Flight - Independent navigation and monitoring
  • 📹 Live Processing - Instant video analysis through ROS
  • ⚡ Fast Response - High-confidence detection alerts

File: yolo_dronkit_yangın_tespit.py


🎯 Project 2: Precision Landing Drone

Vision-guided autonomous landing on colored target

What it does:

  • Searches for green square target
  • Tracks target using color detection
  • Automatically centers above target
  • Performs precision landing
  • All fully autonomous!

Key Features:

  • 🟢 Color Detection - HSV-based green target recognition
  • 🎯 Center Alignment - Automatic positioning over target
  • 📐 Precision Control - Real-time position adjustment
  • 🛬 Auto Landing - Smooth and accurate touchdown

File: opencv-dronekit.py


🛠️ Tech Stack

Both projects share:

  • DroneKit-Python - MAVLink flight control
  • ROS Noetic - Robot operating system
  • Gazebo 11 - Realistic simulation
  • OpenCV - Computer vision processing
  • PyMAVLink - Communication protocol

📋 Requirements

Environment:

  • Ubuntu 20.04 LTS
  • ROS Noetic
  • Gazebo 11
  • Python 3.8+

Python Packages:

pip install dronekit pymavlink opencv-python numpy
pip install rospkg cv-bridge

For Fire Detection Only:

# YOLOv4 weights and config files required
# See yolo/ directory

🚀 Quick Start

Fire Detection Project

# Start ROS and Gazebo
roscore
# Launch drone simulation in another terminal

# Run fire detection
python3 yolo_dronkit_yangın_tespit.py

Precision Landing Project

# Start ROS and Gazebo
roscore
# Launch drone simulation in another terminal

# Run precision landing
python3 opencv-dronekit.py

⚙️ Configuration

Common Settings:

connection_string = "127.0.0.1:14550"  # SITL connection
webcam = "/webcam/image_raw"           # Camera topic

Fire Detection:

confidence > 0.5  # Detection threshold

Precision Landing:

hız = 1  # Flight speed (m/s)
# Green HSV range: [40,50,50] to [80,255,255]

📁 Repository Structure

├── yolo/
│   ├── my_yolov4.cfg           # YOLOv4 config
│   ├── my_yolov4_final.weights # Trained weights
│   └── _darknet.names          # Class names
├── yolo_dronkit_yangın_tespit.py  # Fire detection
├── opencv-dronekit.py             # Precision landing
└── README.md

Turkish

🚁 İçeride Neler Var?

Bu repo, DroneKit ve bilgisayarlı görü ile geliştirilmiş iki otonom dron projesi içeriyor. Her ikisi de ROS Gazebo simülasyonunda çalışıyor ve dron otonomisinin farklı gerçek dünya uygulamalarını gösteriyor.


🔥 Proje 1: Yangın Tespit Dronu

YOLOv4 derin öğrenme ile otonom yangın tespit sistemi

Ne yapıyor:

  • Belirlenen irtifada otonom uçuyor
  • Canlı kamera görüntüsünü YOLOv4 ile işliyor
  • Gerçek zamanlı yangın tespit ediyor
  • Sınırlayıcı kutularla görsel uyarı veriyor
  • İzleme yaparken devriye görevine devam ediyor

Ana Özellikler:

  • 🔥 Gerçek Zamanlı Yangın Tespiti - Yangın tanıma için eğitilmiş YOLOv4 modeli
  • 🤖 Otonom Uçuş - Bağımsız navigasyon ve izleme
  • 📹 Canlı İşleme - ROS üzerinden anlık video analizi
  • ⚡ Hızlı Tepki - Yüksek güvenilirlikli tespit uyarıları

Dosya: yolo_dronkit_yangın_tespit.py


🎯 Proje 2: Hassas İniş Dronu

Görüntü güdümlü renkli hedefe otonom iniş

Ne yapıyor:

  • Yeşil kare hedefi arıyor
  • Renk tespiti ile hedefi takip ediyor
  • Otomatik olarak hedefin üstüne merkezleniyor
  • Hassas iniş gerçekleştiriyor
  • Tamamen otonom!

Ana Özellikler:

  • 🟢 Renk Tespiti - HSV tabanlı yeşil hedef tanıma
  • 🎯 Merkez Hizalama - Hedef üzerinde otomatik konumlanma
  • 📐 Hassas Kontrol - Gerçek zamanlı konum ayarlama
  • 🛬 Otomatik İniş - Yumuşak ve hassas iniş

Dosya: opencv-dronekit.py


🛠️ Teknoloji Yığını

Her iki proje de şunları paylaşıyor:

  • DroneKit-Python - MAVLink uçuş kontrolü
  • ROS Noetic - Robot işletim sistemi
  • Gazebo 11 - Gerçekçi simülasyon
  • OpenCV - Bilgisayarlı görü işleme
  • PyMAVLink - İletişim protokolü

📋 Gereksinimler

Ortam:

  • Ubuntu 20.04 LTS
  • ROS Noetic
  • Gazebo 11
  • Python 3.8+

Python Paketleri:

pip install dronekit pymavlink opencv-python numpy
pip install rospkg cv-bridge

Sadece Yangın Tespiti İçin:

# YOLOv4 ağırlık ve config dosyaları gerekli
# yolo/ dizinine bakın

🚀 Hızlı Başlangıç

Yangın Tespit Projesi

# ROS ve Gazebo'yu başlat
roscore
# Başka bir terminalde dron simülasyonunu başlat

# Yangın tespitini çalıştır
python3 yolo_dronkit_yangın_tespit.py

Hassas İniş Projesi

# ROS ve Gazebo'yu başlat
roscore
# Başka bir terminalde dron simülasyonunu başlat

# Hassas inişi çalıştır
python3 opencv-dronekit.py

⚙️ Konfigürasyon

Ortak Ayarlar:

connection_string = "127.0.0.1:14550"  # SITL bağlantısı
webcam = "/webcam/image_raw"           # Kamera topic

Yangın Tespiti:

confidence > 0.5  # Tespit eşiği

Hassas İniş:

hız = 1  # Uçuş hızı (m/s)
# Yeşil HSV aralığı: [40,50,50] - [80,255,255]

📁 Repository Yapısı

├── yolo/
│   ├── my_yolov4.cfg           # YOLOv4 konfigürasyon
│   ├── my_yolov4_final.weights # Eğitilmiş ağırlıklar
│   └── _darknet.names          # Sınıf isimleri
├── yolo_dronkit_yangın_tespit.py  # Yangın tespiti
├── opencv-dronekit.py             # Hassas iniş
└── README.md

Releases

No releases published

Packages

No packages published

Languages