Git Product home page Git Product logo

droneui's Introduction

Spot On Automated Drone Surveying System

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.

Modules

  • mavutil from pymavlink for handling MAVlink communication.
  • math
  • tkinter GUI package
  • pytest for testing
  • TkinterMapView from tkintermapview for embedded map in GUI
  • Image, ImageTk from PIL for image processing of GUI icons
  • threading for running simultaneous threads of execution

Project Structure

Communication Class

Responsible 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.

SingletonRoot Class

A singleton class that extends tk.Tk for creating a single instance of the main application window.

Model Class

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.

View Class

Manages the GUI for the application.

  • Implements GUI elements.
  • Functions to update the map view and coordinate list.
  • Integrates with TkinterMapView for embedded map.

Controller Class

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.

Main Execution

  • Initializes the SingletonRoot and Controller classes.
  • Starts the Tkinter main loop.

Usage

With Gazebo and ArdupilotSITL:

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.

  • Start Gazebo
    • gazebo --verbose ~/path/to/world/file
  • Start ArduPilot SITL
    • sim_vehicle_script.py -v ArduCopter -f gazebo -drone_model_file -L WORLD_LOCATION_COORDINATES --console --out <\ip and port # of computer running the Spot On script. or nothing if you are using the same computer>
    • The spot on script currently accepts a connection from any ip on the network on port 14550.
  • Run the script to start the application.
  • Enter an address in the address bar to center the map view on the desired location.
  • Right click on the locations where property markers will be placed, select 'add coordinates' from the drop down.
  • Click 'Fly' to start the drone operation based on the provided coordinates.
  • The map within the GUI window will update with the drone's current location in relation to each waypoint

droneui's People

Contributors

jackhlay avatar mynamecharlesrothbaum avatar

Watchers

 avatar

droneui's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.