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.
- This project is developed in crazyswarm (see: https://crazyswarm.readthedocs.io/en/latest/index.html)
- Firstly you should install Ros (see: https://www.ros.org/)
- Then you should install crazyswarm. We will use 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
- 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
- It is a control menu created to simulate the developed algorithms.
- 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.
- The formation that can be entered is selected according to the number of drones.
- Different tasks can be performed with the specified numbers.
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.
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.
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.
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.
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.
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.
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.