This project implements a drone navigation system using Python. It allows users to input GPS coordinates, generates a flight plan, and controls a drone to fly over these coordinates.
mavutil
from pymavlink
for handling MAVlink communication.math
tkinter
GUI packagepytest
for testing TkinterMapView
from tkintermapview
for embedded map in GUIImage
, ImageTk
from PIL
for image processing of GUI iconsthreading
for running simultaneous threads of executionResponsible for all the MAVLink communication with the drone, including sending commands and receiving information.
get_distance_global
: Calculates the Euclidean distance between two GPS points.get_current_lat
and get_current_lon
: Fetches the current latitude and longitude from the drone.connect
: Establishes a connection to the drone.takeoff
: Commands the drone to take off to a specified altitude.land
: Commands the drone to land.send_waypoint_global
: Sends a waypoint to the drone and waits until it reaches the location.get_takeoff_lat
and get_takeoff_lon
: Gets the latitude and longitude of the takeoff location.process_planArr
: Processes an array of coordinates and commands the drone to fly to each point.isInRange
: Checks if a target location is within a specified range from the takeoff point.A singleton class that extends tk.Tk
for creating a single instance of the main application window.
Holds data related to GPS coordinates and notifies observers when changes occur.
add_coordinate
: Adds a new GPS coordinate.register_observer
and notify_observers
: Observer pattern implementation for MVC architecture.generate_plan
: Generates a list of coordinates with the current coordinates.Manages the GUI for the application.
TkinterMapView
for embedded map.Acts as an intermediary between the View and Model, handling user inputs and updating the view.
add_coordinates
: Adds coordinates to the model.generate_plan
: returns a sequence of coordinates from the model's coordinates.fly_button_pressed
: Initiates the drone operation sequence.start_drone_operations
: Starts a new thread for drone operations to run while the GUI updates with the drone's location. SingletonRoot
and Controller
classes.Gazebo is a free open source physics engine designed for testing automated systems. You can create custom world files that contain 3d models for the automated entities, moving parts, and the environment. ArdupilotSITL is an softare implementation of a flight controller running ArduPilot. It handles control of the drone using its current orientation in the simulated environment. Using Ardupilot SITL with Gazebo allows us to test the behavior of our software without the risk of damaging real hardware.