CoFlyers
CoFlyers: A General Platform for Collective Flying of Swarm Drones.
Install / Use
/learn @micros-uav/CoFlyersREADME
CoFlyers
CoFlyers: a universal platform for collective flying of swarm drones
IROS2023
<p align="center"> <img src="./docs/images/CoFlyers_Logo.png" alt="figure" height="200"> </p>Contents
<!-- @import "[TOC]" {cmd="toc" depthFrom=2 depthTo=6 orderedList=false} --> <!-- code_chunk_output -->- CoFlyers
- Contents
- Introduction
- Requirements
- Installation
- Overview
- A step-by-step example
- Swarm algorithm and evaluation metrics
- Rapid prototyping of swarm algorithms
- Parameter auto-tuning of swarm algorithms
- Batch-processing analysis of swarm algorithms
- High-fidelity simulation of swarm algorithms
- Real-world experimental verification with Tello&OptiTrack
- Real-world experimental verification with Crazyswarm&OptiTrack
- Verification combined with reality and virtuality
- Troubleshooting
Introduction
CoFlyers is a platform for evaluating and verifying cooperative motion algorithm/model of drone swarms. It only requires users to have programming skills in MATLAB&Simulink. CoFlyers allows users to perform six typical functions: rapid prototyping, parameter auto-tuning, batch processing, high-fidelity simulation, real-world experimental verification, and verification combined with virtual and reality.
- Rapid protyping
- Parameter auto-tuning for getting the optimized parameters
- Batch processing for obtaining the impact of internal and external parameters on swarm performances
- High-fidelity simulation with ROS&PX4&Gazebo
- Eeal-world experimental verification with Tello&Optitrack
- Eeal-world experimental verification with Crazyswarm&Optitrack
- verification combined with virtual and reality
Requirements
- Only MATLAB R2021b or later for prototype simulator, simulink commander. (Ubuntu and Windows are supported)
- Working installation of PX4 and Gazebo for high-fidelity simulation. (Ubuntu18.04 are supported)
- For the implementation of real-world experimental verification with Tello&OptiTrack, a Windows system is required without any other dependencies.
- Working installation of crazyswarm for real-world experimental verification with Crazyswarm&OptiTrack (Ubuntu18.04 are supported).
Installation
- Clone the CoFlyers git repository or download it directly:
- For simulation with PX4, copy some files for PX4
- For experiments with Crazyswarm, copy some files for Crazyswarm
Currently, it is a problem with the publish frequency to the /cf#/pose topic created by Crazyswarm. It cannot be performed at a faster frequency of 30 Hz. If users' Crazywarm can normally pulish poses to /cf#/pose topic at a frequency of 30 Hz, it is no need to replace the source code with the following command:
<pre><code>sudo cp ./CoFlyers/for_external_projects/crazyswarm/crazyswarm_server.cpp ./crazyswarm/ros_ws/src/crazyswarm/src cd ./crazyswarm/ros_ws catkin_make</code></pre>Build:
<pre><code>cd ./crazyswarm/ros_ws catkin_make</code></pre>Overview
<p align="center"> <img src="./docs/images/overview-English.png"alt="figure" height="400"> </p> <p align="center" style="color: #999;"> Overall architecture of CoFlyers </p> <br>The platform of CoFlyers generally has four components: a prototype simulator, a verification system for drone swarms, a graphical user interface (GUI) for drawing, and a GUI for simulating. The prototype simulator provides the functions of rapid prototyping, parameter auto-tuning, and batch processing. The verification system for drone swarms provides the functions of high-fidelity simulation, real-world experimental verification, and verification combined with vitual and reality. The GUI for drawing allows users to interactively edit 3D simulated obstacle environments. The GUI for simulating allows users to interactively operate the prototype simulator, manually tune parameters, and observe simulation results. The prototype simulator and the two GUI are developed entirely based on the MATLAB programming language. And the verification system for drone swarms directly inherits the modules of the prototype simulator, relying on the characteristics of Simulink, which is integrated with MATLAB. In this way, users are not required to repeat programming while using advanced functions.
Prototype simulator
<p align="center"> <img src="./docs/images/prototype_simulator-English.png" alt="figure" height="300"> </p> <p align="center" style="color: #999;"> Architecture of prototype simulator </p> <br>The prototype simulator is developed based on a layered and modular idea. Its layers and modules are shown in the above figure. The swarm module and evaluation module are the main modules that users need to pay attention to and develop. The two are used respectively for deploying swarm algorithms and evaluation metrics of swarm performances.
The module parameters of the simulator are all configured in a parameter configuration file in XML format. The post-processing program will automatically generate MATLAB script functions that define parameters based on this configuration file for use by other functions in each module. In addition, for the swarm module and evaluation module, after users add sub modules in the configuration file, the post-processing program will automatically generate MATLAB functions with standard input and output, which are used to deploy the user's codes related to swarm algorithms and evaluation metrics.
Graphical user interface for drwaing
<br> <p align="center"> <img src="./docs/images/Gui_map_X5.gif" alt="figure" height="400"> </p> <p align="center" style="color: #999;"> Graphical user interface for drawing </p>The GUI for drawing is used to provide users with a tool that can interactively and visually configure a 3D simulated obstacle environment.
Graphical user interface for simulating
<br> <p align="center"> <img src = "./docs/images/Gui_sim_PSO_X5.gif" width = "45%" hight="300"> <img src = "./docs/images/Gui_sim_v18_X5.gif" width = "45%" hight="300"> </p> <p align="center" style="color: #999;"> Graphical user interface for simulating (left: PSO, right: Vásárhelyi) </p> <br>The GUI for simulating is used to provide users with a tool that can interactively and visually debug algorithm parameters and observe results.
Verification system for drone swarms
The verification system for drone swarms generally has three components: swarm commander, communication forwarding module, and external system. The swarm commander is developed in Simulink, directly inheriting the modules of the prototype simulator. It receives the pose data of all drones from external and sends upper-level commands to all drones. The connect between the swarm commander and other components uses UDP communication and standardized communication protocol. For each drone, a UDP port is set up to receive the pose of the corresponding drone and send upper-level commands to the drone. Thus, as long as comm ports and data are defined using the standardized communication protocol, any type of external system can communicate with the swarm commander. In this way, our swarm commander is
