Headline: A Swarm Algorithm for Following Formations using Crazyflie Drones
This repository serves as a hub for supplementary materials related to the paper A Swarm Algorithm for Following Formations using Crazyflie Drones. It includes the prototypical implementation in our NetLogo simulation, as well as the ROS2 Python implementations of the swarm behaviors described in the paper. These behaviors include the "chain-like" following implementation and the V-shape formation.
Additionally, proof-of-concept videos and videos related to the empirical investigations can be accessed via the following YouTube playlist.
All videos can be accessed on the YouTube playlist.
-
Following Algorithm as Swarm Behavior
Chain and V-shape swarm algorithms, initialization, and robustness:
The following ROS2 Python implementations correspond to the swarm behaviors described in the paper and are compatible with Protease 2.0 (DOI:10.1007/s10009-025-00834-w):
- Chain-like Following Swarm Behavior: ros2-implementation/chain.py
- V-Shape Following Swarm Behavior: ros2-implementation/v-shape.py
The NetLogo simulation implementation of the swarm behaviors described in the paper requires the NetLogo 3D tool, which can be downloaded from the official NetLogo website.
- Main Simulation File: netlogo-simulation/swarm-following.nlogo
This NetLogo model simulates swarm behavior in a 3D environment. The following functionalities are provided:
-
Setup: Initializes the simulated agents (drones) at random positions within the 3D environment.
-
Go: Starts the simulation, which progresses in discrete time steps (ticks). During the simulation:
- Agents search for neighbors within their visibility radius and select them as followers.
- The process begins with a user-controlled reference point, which can be moved using WASD keyboard inputs or predefined scripts.
- Scripts can be combined (e.g., linear movement combined with circular movement) to create complex motion patterns.
- The resulting movements cause the agents to form a chain-like structure that follows the reference point.
-
Add Agent: Spawns new agents at random positions. These agents are integrated into the existing formation.
-
Remove Agent: Removes selected agents. Removed agents initially move toward the ground and disappear. Remaining agents detect the disconnection after a timeout period and re-integrate into the existing formation.
This model allows testing the robustness and scalability of the swarm behavior by dynamically adding or removing agents during the simulation.



