This project presents a generalized framework for formation control of event-driven UAV swarms built on ROS Noetic and Gazebo with ArduPilot SITL.
The framework enables multiple UAVs to fly cooperatively in structured formations that can dynamically adapt to user commands or autonomous mission events.
Developed under the Communication Systems and Networking Lab, NUST University, this work was supported by a major industrial partner for advancing research in multi-robot coordination and autonomous swarm intelligence.
💡 The project has been successfully and thoroughly tested on hardware in various field trials. Robustness of the approach has been validated with a multi-UAV system of upto 5 drones.
-
Generalized ROS-based Swarm Framework:
Modular design allowing scalable swarm formations with multiple UAVs. -
Event-Driven Formation Switching:
UAVs can modify formations based on:- RC user input, or
- Autonomous signals triggered by mission logic.
-
Multi-Formation Support:
Implemented formations:- Line formation
- Flock formation
- Helical (Vertical Spiral) formation
-
Fully Simulated in ROS + Gazebo + ArduPilot SITL & Validated on Actual Hardware
Integrates MAVROS, MAVProxy, and ArduCopter for realistic flight dynamics. The framework has also been successfully tested in various field trials. -
Python-Based Implementation:
Clean, modular Python scripts for leader–follower control, swarm API, and autonomous decision-making.
| Component | Description |
|---|---|
| Leader Drone | Defines formation geometry and reference trajectory. |
| Follower Drones | Maintain relative positioning using ROS topics and MAVROS communication. |
| Swarm API | Provides unified functions for swarm takeoff, landing, and formation switching. |
| Event Handler | Triggers formation changes based on RC or programmed logic. |
| Gazebo Simulation | Visualizes multi-drone behavior in 3D environment using ArduPilot SITL. |
fabeha-raheel-swarm-formation-control/
├── docs/ # Detailed setup, simulation, and troubleshooting guides
├── launch/ # ROS launch files for leader, follower, and full swarm control
├── models/ # Custom drone and world models for Gazebo
├── scripts/ # Python scripts implementing swarm logic and APIs
│ ├── SwarmLeader_API.py
│ ├── SwarmFollower_API.py
│ ├── swarm_line_formation.py
│ ├── swarm_flock_formation.py
│ ├── swarm_formation_control_final.py
│ └── swarm_takeoff_and_land.py
└── worlds/ # Gazebo world files (outdoor, runway, etc.)
▶️ Flight 1: Watch on YouTube▶️ Flight 2: Watch on YouTube▶️ Flight 3: Watch on YouTube▶️ Flight 4: Watch on YouTube▶️ Flight 5: Watch on YouTube
- OS: Ubuntu 20.04
- ROS Distribution: ROS Noetic
- Simulator: Gazebo
- Flight Stack: ArduPilot SITL
- Middleware: MAVROS
sudo apt-get install ros-noetic-mavros ros-noetic-mavros-extras
wget https://raw.githubusercontent.com/mavlink/mavros/master/mavros/scripts/install_geographiclib_datasets.sh
chmod +x install_geographiclib_datasets.sh
./install_geographiclib_datasets.shcd ~
mkdir -p swarm_ws/src
cd swarm_ws/src
git clone https://github.com/fabeha-raheel/fabeha-raheel-swarm-formation-control.git
cd ..
catkin_make
source devel/setup.bashcd scripts/
./drone1_startsitl.sh
./drone2_startsitl.sh
./drone3_startsitl.shroslaunch uav_swarms formation_control.launch- Via RC input
- Or programmatically through event handlers in swarm_formation_control_final.py
- Gazebo
- Mission Planner (for telemetry visualization)
Detailed guides are available in the /docs/ folder:
If you use this project or parts of the framework in your research, please cite:
@misc{uav_swarms,
author = {Fabeha Raheel, Hassan Mehmood},
title = {Formation Control of UAV Swarms},
year = {2024},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/fabeha-raheel/swarm-formation-control}},
}
- The project has been funded by industrial partners of the CSN Lab, SEECS, NUST. Special thanks to Dr. Rizwan Ahmed and his team for playing an important part in the realization and successful completion of this project.
- ArduPilot SITL
- MAVROS
- Gazebo Simulator
- ROS Noetic
