Skip to content

sadlim/Swarm-UAV

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Swarm-UAV



Contents

Project Purpose

The need for Swarm Unmanned Aerial Vehicles (Swarm UAV), one of the most important technologies of the near future, is increasing day by day. Swarm UAVs show their importance with both civil and military applications. For example, in a civilian scenario, it will be possible to intervene more effectively in forest fires with Swarm UAVs, and in a military scenario, it will be possible to gain superiority by developing alternative strategies and tactics against existing manned air, land and sea platforms. The main purpose of the Swarm UAV Competition is to compete.Developing software algorithms for the creation of UAVs that can perform the tasks defined in the specification in swarms, demonstrating the performances of these algorithms with Swarm UAVs in the physical environment, as well as guiding young people on the subject and increasing their experience and knowledge.

Installation

How to install Crazyswarm for just Python API

(https://crazyswarm.readthedocs.io/en/latest/installation.html)

1- Set enviroment veriable

$ export CSW_PYTHON=[python2 or python3]

2- Install depencies

$ sudo apt install git make gcc swig lib${CSW_PYTHON}-dev ${CSW_PYTHON}-numpy ${CSW_PYTHON}-yaml ${CSW_PYTHON}-matplotlib

3- Clone Repo

$ git clone https://github.com/USC-ACTLab/crazyswarm.git

4- Run build script

$ cd crazyswarm
$ ./buildSimOnly.sh

Features

  • UAV Individual take off, formation in the air
  • Take off with Formation
  • Adding a new individual to the Swarm
  • Removal of individual from the Swarm
  • Changing Swarm direction with formation protection
  • Formation change
  • Swarm separation
  • Swarm merge
  • Swarm navigation
  • Ascent and descent with swarm
  • Simultaneous / sequential auto-landing with Swarm

Simulation


Menu

  • It is a control menu created to simulate the developed algorithms.

ss

  • First of all, choose drone number.
  • Second, choose whether the drones will take off simultaneously or individually.
  • Choose how many meters they will rise.
  • Choose the distance between drones.

ss1

  • The formation that can be entered is selected according to the number of drones.

ss2

  • Different tasks can be performed with the specified numbers.

Algorithms

-set_triang_formation

The purpose of this function is to create a triangle formation with the UAVs in the system
      --Parameters the Function Takes Are
             1- distance = is the distance between the two vertices of the triangle you want to form
             2- drone_number = number of drones in the system
             3- init_point = center at the time the swarm members call a function
             4- altitude = height of swarm members
             5- rotation = angles of swarm members with respect to the main coordinate system

      --Description Of the Algorithm
             Step 1 = 3x3 unit matrix named desired_matrix is created for the three corners of the triangle to be created. Where the rows represent UAVs. The 1st column represents the x-axis, the 2nd column represents the y-axis, and the 3rd column represents the z-axis.

              Step 2 = 3 line arrays are created for the side lines of the triangle, but they are empty. Will be resized.

              Step 3 = On the relative coordinate system on which the swarm system is located, the corner points of the triangle are calculated using geometric relations and assigned to the desired_matrix.

              Step4 = If there are more than three UAVs in the swarm, they are placed on the border lines by editing the line variable with the re_construct_line function(The re_construct_line function will be explained later).

              Step5 = All of the specified coordinates are assigned to the desired_matrix variable and the transformed_matrix is created.

              Step 6 = All coordinates are arranged according to the absolute frame with the transformation_2d function and transferred to the transformed_matrix.

-set_square_formation:

The purpose of this function is to create a square formation with the UAVs in the system.
       --Parameters the Function Takes Are:
             1- distance = is the distance between the two vertices of the square you want to form.
             2- drone_number = number of drones in the system
             3- init_point = center at the time the swarm members call a function
             4- altitude = height of swarm members
             5- rotation = angles of swarm members with respect to the main coordinate system

      --Description Of the Algorithm:
             Step 1 = 4x3 unit matrix named desired_matrix is created for the four corners of the square to be created. Where the rows represent UAVs. The 1st column represents the x-axis, the 2nd column represents the y-axis, and the 3rd column represents the z-axis.
             Step 2 = 4 line arrays are created for the side lines of the square, but they are empty. Will be resized.
             Step 3 = On the relative coordinate system on which the swarm system is located, the corner points of the square are calculated using geometric relations and assigned to the desired_matrix.
             Step4 = If there are more than four UAVs in the swarm, they are placed on the border lines by editing the line variable with the re_construct_line function(The re_construct_line function will be explained later).
             Step5 = All of the specified coordinates are assigned to the desired_matrix variable and the transformed_matrix is created.
             Step 6 = All coordinates are arranged according to the absolute frame with the transformation_2d function and transferred to the transformed_matrix.

-set_v_formation

The purpose of this function is to create a ‘v’ formation with the UAVs in the system.
       --Parameters the Function Takes Are:
             1- distance = is the distance between the two vertices of the ‘v’ you want to form.
             2- yaw_angle = is the angle between two lines.
             3- drone_number = number of drones in the system
             4- init_point = center at the time the swarm members call a function
             5- altitude = height of swarm members
             6- rotation = angles of swarm members with respect to the main coordinate system

      --Description Of the Algorithm:
             Step 1 = (drone_number)x3 unit matrix named desired_matrix is created for each element of the formation to be created. Where the rows represent UAVs. The 1st column represents the x-axis, the 2nd column represents the y-axis, and the 3rd column represents the z-axis.
             Step 2 = On the relative coordinate system on which the swarm system is located, the lines of the v formation are calculated using geometric relations and assigned to the desired_matrix.
             Step 3 = All of the specified coordinates are assigned to the desired_matrix variable and the transformed_matrix is created.
             Step 4 = All coordinates are arranged according to the absolute frame with the transformation_2d function and transferred to the transformed_matrix.

-set_pentagon_formation:

The purpose of this function is to create a pentagon formation with the UAVs in the system.
       --Parameters the Function Takes Are:
             1- distance = is the distance between the two vertices of the pentagon you want to form.
             2- drone_number = number of drones in the system
             3- init_point = center at the time the swarm members call a function
             4- altitude = height of swarm members
             5- rotation = angles of swarm members with respect to the main coordinate system

      --Description Of the Algorithm:
             Step 1 = 5x3 unit matrix named desired_matrix is created for the five corners of the pentagon to be created. Where the rows represent UAVs. The 1st column represents the x-axis, the 2nd column represents the y-axis, and the 3rd column represents the z-axis.
             Step 2 = 5 line arrays are created for the side lines of the pentagon, but they are empty. Will be resized.
             Step 3 = On the relative coordinate system on which the swarm system is located, the corner points of the pentagon are calculated using geometric relations and assigned to the desired_matrix.
             Step4 = If there are more than five UAVs in the swarm, they are placed on the border lines by editing the line variable with the re_construct_line function(The re_construct_line function will be explained later).
             Step5 = All of the specified coordinates are assigned to the desired_matrix variable and the transformed_matrix is created.
             Step 6 = All coordinates are arranged according to the absolute frame with the transformation_2d function and transferred to the transformed_matrix.

-set_star_formation:

The purpose of this function is to create a star formation with the UAVs in the system.
       --Parameters the Function Takes Are:
             1- distance = is the distance between the two vertices of the star you want to form.
             2- drone_number = number of drones in the system
             3- init_point = center at the time the swarm members call a function
             4- altitude = height of swarm members
             5- rotation = angles of swarm members with respect to the main coordinate system

      --Description Of the Algorithm:
             Step 1 = 10x3 unit matrix named desired_matrix is created for the ten corners of the star to be created. Where the rows represent UAVs. The 1st column represents the x-axis, the 2nd column represents the y-axis, and the 3rd column represents the z-axis.
             Step 2 = 10 line arrays are created for the side lines of the star, but they are empty. Will be resized.
             Step 3 = On the relative coordinate system on which the swarm system is located, the corner points of the star are calculated using geometric relations and assigned to the desired_matrix.
             Step4 = If there are more than ten UAVs in the swarm, they are placed on the border lines by editing the line variable with the re_construct_line function(The re_construct_line function will be explained later).
             Step5 = All of the specified coordinates are assigned to the desired_matrix variable and the transformed_matrix is created.
             Step 6 = All coordinates are arranged according to the absolute frame with the transformation_2d function and transferred to the transformed_matrix.

-set_crescent_formation:

The purpose of this function is to create a crescent formation with the UAVs in the system.
       --Parameters the Function Takes Are:
             1-radius = determines the radius of the crescent that will be created
             2- gap_angle = represents the angle value of the part of the crescent that will be empty
             3- drone_number = number of drones in the system
             4- init_point = center at the time the swarm members call a function
             5- altitude = height of swarm members
             6- rotation = angles of swarm members with respect to the main coordinate system

      --Description Of the Algorithm:
             Step1 = 2 endpoints of the crescent are determined
             Step 2 = (drone_number)x3 unit matrix named desired_matrix is created to generate the crescent line. Where the rows represent UAVs. The 1st column represents the x-axis, the 2nd column represents the y-axis, and the 3rd column represents the z-axis.
             Step 3 =In the while loop, the coordinates of each UAV are calculated according to the angle values and transferred to the desired_matrix.
             Step4 = All of the specified coordinates are assigned to the desired_matrix variable and the transformed_matrix is created.
             Step5 = All coordinates are arranged according to the absolute frame with the transformation_2d function and transferred to the transformed_matrix.

-set_circle_formation:

The purpose of this function is to create a cicle formation with the UAVs in the system.
       --Parameters the Function Takes Are:
             1-radius = determines the radius of the crescent that will be created
             2- drone_number = number of drones in the system
             3- init_point = center at the time the swarm members call a function
             4- altitude = height of swarm members
             5- rotation = angles of swarm members with respect to the main coordinate system

      --Description Of the Algorithm:
             Step1 = The first point is passed to the variable point 1
             Step 2 = (drone_number)x3 unit matrix named desired_matrix is created to generate the circle line. Where the rows represent UAVs. The 1st column represents the x-axis, the 2nd column represents the y-axis, and the 3rd column represents the z-axis.
             Step 3 = According to the radius value received and the number of UAVs, the positions to be reached in the while loop are calculated and transferred to the desired_matrix variable.
             Step4 = All of the specified coordinates are assigned to the desired_matrix variable and the transformed_matrix is created.
             Step5 = All coordinates are arranged according to the absolute frame with the transformation_2d function and transferred to the transformed_matrix.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%