Giter Site home page Giter Site logo

tomantoine / multi-uav-simulator Goto Github PK

View Code? Open in Web Editor NEW
38.0 4.0 8.0 129.53 MB

AVDC 2021 - GNC of a SWARM of UAVs in a numerical simulation by Alex Martinez and Tom Antoine

License: MIT License

Python 100.00%
pydy python simulator simulation drone uav swarm gnc guidance potential-field

multi-uav-simulator's Introduction

Multi-UAV-simulator

GNC of a SWARM of UAVs in a SITL by Tom Antoine and Alex Martinez - Cranfield University AVDC MSc 2021

This project is composed of two independant but similar repositories:

  • Simulation_Python : it is used to do numerical simulations on the guidance algorithm fully on Python (see below)
  • Simulation_Gazebo : here, the python code for guidance is used as SITL, for a Gazebo/ROS/Ardupilot world (https://github.com/alexMarFar/multi-UAV-simulator.git)

Simulation_Python

Prerequisites:

Python 3.8.5 was employed, so full compability with that or after version Basic Python libraries such as matplotlib, math, etc

Main Files

run_3D_simulation.py

It is the main script from where the simulation is launched.

In the main, the scenario is selected and the quadcopters are initialized.

Then the simulation is run by calling run_sim and the data can be visualized in plots or 3D animations.

scenarios.py

It holds the main scenarios that were employed for V&V in the numerical simulation.

It also includes the explanation for each input needed to run the code.

pf3d.py

It is the script for the Guidance algorithm, in this case the potential field in 3D.

It can be easily exchanged by another algorithm. It returns discrete waypoints.

trajectory.py, waypoints.py and ctrl.py

They hold the control and trajectory generation based on waypoints.

run_3D_simulation_loop.py

Created in order to test simulations many times with randomized parameters, in order to do statistical V&V. It is very similar to the run_3D_simulation, but doesnt plot results for each simulation, only histograms plotting relevant data from the many simulations done.

quadFiles folder

quad.py

In order to implement the drones, both agents and enemies, the Quad class was created. This is a file that is used to firstly initialize the drones as independent objects and to assign and update their attributes.

This method of implementation allowed a very easy and intuitive use of the code, as well as an unlimited scalability of the SWARM.

For the initialization to happen several inputs need to be provided. The main ones are the drone identification number “quad_id”, the keyword “mode”, the target identification number “id_targ”, the goal position “pos_goal” and the position of static obstacles “pos_obs”.

initQuad.py

Initializes quad parameters

utils folder

animation.py

Creates the 3D animation

display.py

Creates the plots for the analysis

How to launch the simulation

Open Terminal 1

cd Simulation_Python/
  1. to run one simulation

    python run_3D_simulation.py
    
  2. to run multiple simulations for statistical results

    python run_3D_simulation_loop.py
    

multi-uav-simulator's People

Contributors

tomantoine avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

multi-uav-simulator's Issues

bug in Simulation

hi tom Antoine ,
quad in sim, not correct to position defined, why?
Screenshot from 2021-05-19 21-31-41

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.