ArticlePDF Available

Abstract and Figures

The focus of this work is to present a novel methodology for optimal distribution of a swarm formation on either side of an obstacle, when evading the obstacle, to avoid overpopulation on the sides to reduce the agents' waiting delays, resulting in a reduced overall mission time and lower energy consumption. To handle this, the problem is divided into two main parts: 1) the disturbance phase: how to morph the formation optimally to avoid the obstacle in the least possible time in the situation at hand, and 2) the convergence phase: how to optimally resume the intended formation shape once the threat of potential collision has been eliminated. For the first problem, we develop a methodology which tests different formation morphing combinations and finds the optimal one, by utilizing trajectory, velocity, and coordinate information, to bypass the obstacle. For the second problem, we utilize a thin-plate splines (TPS) inspired temperature function minimization method to bring the agents back from the distorted formation into the desired formation in an optimal manner, after collision avoidance has been successfully performed. Experimental results show that, in the considered test scenario, the proposed approach results in substantial energy savings as compared with the traditional methods.
Content may be subject to copyright.
Heliyon 7 (2021) e07840
Contents lists available at ScienceDirect
Heliyon
journal homepage: www.cell.com/heliyon
Research article
Swarm formation morphing for congestion-aware collision avoidance
Jawad N. Yasin a,, Mohammad-Hashem Haghbayan a, Muhammad Mehboob Yasin b,
Juha Plosila a
aAutonomous Systems Laboratory, Department of Future Technologies, University of Turku, Vesilinnantie 5, 20500 Turku, Finland
bDepartment of Computer Networks, College of Computer Sciences & Information Technology, King Faisal University, Hofuf, Saudi Arabia
A R T I C L E I N F O A B S T R A C T
Keywords:
Multi-agent systems
Autonomous swarm
Congestion awareness
Swarm intelligence
Collision avoidance
Formation maintenance
The focus of this work is to present a novel methodology for optimal distribution of a swarm formation on
either side of an obstacle, when evading the obstacle, to avoid overpopulation on the sides to reduce the agents’
waiting delays, resulting in a reduced overall mission time and lower energy consumption. To handle this, the
problem is divided into two main parts: 1) the disturbance phase: how to morph the formation optimally to
avoid the obstacle in the least possible time in the situation at hand, and 2) the convergence phase: how to
optimally resume the intended formation shape once the threat of potential collision has been eliminated. For
the first problem, we develop a methodology which tests different formation morphing combinations and finds
the optimal one, by utilizing trajectory, velocity, and coordinate information, to bypass the obstacle. For the
second problem, we utilize thin-plate splines (TPS) inspired temperature function minimization method to bring
the agents back from the distorted formation into the desired formation in an optimal manner, after collision
avoidance has been successfully performed. Experimental results show that, in the considered test scenario, the
proposed approach results in substantial energy savings as compared with the traditional methods.
1. Introduction
The study of the behavior of a system comprising a large num-
ber of autonomous agents that interact amongst themselves as well as
the environment is generally classified as swarm robotics [1, 2]. The
compliance of comparatively simple control routines serves as the un-
derlying foundation of swarm robotics, i.e., a multi-agent system. The
agents, individually or collaboratively, obey the routines while utiliz-
ing their respective on-board perception sensors and communicating
with other neighboring agents [3]. Study of swarms of UAVs (drones)
has seen a rising interest from the research community due to their
integration in diverse application fields, such as transportation [4],
atmospheric research [5], surveillance [6], entertainment [7], and map-
ping in GPS-denied environments [8], due to their ability to work in a
collaborative and cooperative manner [9]. Navigation of a swarm of
agents introduces several research challenges. Among these, the two
most significant ones are formation maintenance and collision avoid-
ance [10]. Collision avoidance systems are responsible for guiding an
autonomous agent in order to safely and reliably avoid potential col-
lisions with other agents in the swarm as well as with other objects
in the environment [11]. For agents to be fully autonomous, not hav-
*Corresponding author.
E-mail address: janaya@utu.fi (J.N. Yasin).
ing to bank on a central server increases the robustness of the system,
and therefore the ability to locally sense and avoid objects in the envi-
ronment becomes of greater importance. This local collision avoidance
ability becomes even more vital in a multi-agent system where multiple
agents are collaborating together to achieve a desired task, for instance
navigation to the desired destination [12]. Moreover, formation main-
tenance algorithms are responsible for guiding the agents to maintain
a certain/desired shape, i.e., location of every agent is defined with re-
spect to other agents in the swarm [13]. Formation control approaches
can be divided into the following three categories, i.e., leader-follower
based approach [10, 14], behavior-based approach [15, 16], and virtual
structure based approach [17, 18]. Among the aforementioned method-
ologies, the leader-follower based approach is more common pertaining
to its ease of analysis, robustness, scalability, and implementation [13,
19].
Reducing energy consumption to increase mission life is another im-
portant research area in swarm robotics, focusing on a diverse set of
topics, such as efficient decision making [20], minimization of trav-
eling distance [21], energy efficient communication for swarm robot
coordination [22], decreasing the usage of ranging sensors [23], and au-
tonomous recharging [24]. In this paper, we present a novel approach to
https://doi.org/10.1016/j.heliyon.2021.e07840
Received 28 June 2021; Received in revised form 31 July 2021; Accepted 17 August 2021
2405-8440/©2021 The Author(s). Published by Elsevier Ltd. This is an open access article under the CC BY license (http://creativecommons.org/licenses/by/4.0/).
J.N. Yasin, M.-H. Haghbayan, M.M. Yasin et al. Heliyon 7 (2021) e07840
Fig. 1. Illustration of encountered obstacles (a) extending more towards the left w.r.t. the swarm, (b) centered with the swarm, i.e., left or right edges of the obstacle
lie at same distance, (c) extending more towards the right w.r.t. the swarm.
avoid congestion that may occur due to the overpopulation in either of
the available gaps between the obstacles, resulting in delays and conse-
quently higher energy consumption of the agents as well as the swarm
as a whole. This is handled in two phases: the first is the estimation
phase for finding the optimal distribution of the agents into sub-groups
for formation morphing while bypassing the obstacles, and the second
is bringing the agents back into the intended formation shape, i.e., a
reformation step. In the estimation phase, as soon as the obstacles are
detected, the leader utilizes the coordinate, velocity, and trajectory in-
formation of the agents in the swarm to estimate and find the optimal
distribution of the agents through the available gaps between the ob-
stacles. Once the obstacle avoidance is successfully achieved, the agents
are brought back into the intended formation shape by utilizing a tem-
perature minimization function, that is inspired by the thin-plate splines
technique.
The rest of the paper is structured as follows. Related work is cov-
ered in Section 2. Preliminaries and the problem formulation are de-
scribed in Section 3. Section 4covers the proposed approach in detail.
Experimental setup is given in Section 5. Simulation results and the re-
lated discussion are covered in Section 6. Finally, Section 7provides the
concluding remarks.
2. Related work
In relation to the existing literature, the proposed approach is most
related to the energy-efficient path planning or collision avoidance and
time criticality. Some path planning methods rely on a prior map to
pre-process the data for building navigational paths. For instance, the
vector field approach [25] and Probabilistic Roadmap (PRM) [26] es-
sentially build the path by searching the connectivity graph generated
by randomly sampling the map. In the aforementioned methods, part of
the processing is performed offline to facilitate the online processing.
However, these methods are still computationally expensive, due to the
fact that online processing is still required to go through the graph to
find the path [27].
On the other hand, sampling-based methods, like Batch Informed
Trees (BIT) [28] or Rapidly exploring Random Tree (RRT) based meth-
ods [29], generate paths by taking random samples from the graph and
connecting them. Although such methods have shown potential for gen-
erating paths faster due to their ability to manipulate large scale maps,
they are still computationally heavy especially in complex environ-
ments. Therefore, the ability to find a path within given time constraints
cannot be guaranteed.
Moreover, Multilevel Sub-graph Patrolling (MSP) algorithms [30,
31] divide the map into a number of zones and allocate different zones
to the individual robots. These approaches rely on prior information of
the environment and computations are performed based on that global
information by a central computing unit. Therefore, any change in the
environment may affect the harmony of the system’s optimization as
the predefined trajectories may not be optimal for such changes [32].
The work presented in [33, 34] are the closest related to our pro-
posed approach. However, the congestion aware solution that is benefi-
cial for the swarm as a whole is still not addressed. In [33], the authors
propose a methodology for controlling the velocities of the robots in
case of jams due to over-crowding in a queue. They propose a robot be-
havior regulation rule and integrate it with adaptive cruise control of
the vehicle/robot to adjust the speed in case of high density of robots
in a zone to avoid jamming. In [34], the Spread-Out Localization-Space
Trails (SO-LOST) algorithm is proposed. The approach is focused on re-
ducing the interference between the agents by using the SO-LOST algo-
rithm for generating spatially-separated trails for each robot, one from
the home location to the destination and the other from the destination
to the home location. The authors in [35] present a methodology to pre-
vent congestion among robots, while performing different tasks, based
on a probabilistic reservation model. The model sequentially approxi-
mates for each robot the time to reach the destination in a predefined
priority based order. The schedules are implemented once all the robots
have executed their respective plans in a sequential manner. However,
the presented work does not take into account the overall efficient so-
lution for the swarm as a whole.
3. Problem formulation
Our previous works have focused on: (1) energy-efficient formation
morphing by systematic integration of formation control and collision
avoidance for formation-collision co-awareness and the use of non-rigid
mapping by utilizing a thin-plate splines (TPS) based algorithm to mini-
mize deformation in the swarm [10]; (2) reducing the energy consump-
tion owing to sensor(s) usage in the swarm by introducing the concepts
of translational coordinates based navigation and adaptive conscious-
ness in the agents [23, 36]; and (3) dynamic formation reshaping for
collision avoidance while passing through the available gaps between
the obstacles without slowing down [37].
Current approaches of minimizing the traveling distance while per-
forming collision avoidance maneuvers may adversely impact the en-
ergy efficiency of the swarm owing to congestion on narrow pathways.
This serves as a key motivation for the approach proposed in this paper.
Fig. 1illustrates the scenario where individual drones choose the short-
est path while avoiding an obstacle. If the encountered obstacle is not
aligned with respect to the swarm’s center, as illustrated in Fig. 1(a) and
1(c), more agents will prefer one path (say N1) over the other (say N2)
causing congestion on that path. In the said figure, the group of agents
that will navigate towards N1 or N2 are grouped by encircling them in a
dotted circle for illustration purposes. The resulting congestion or over-
2
J.N. Yasin, M.-H. Haghbayan, M.M. Yasin et al. Heliyon 7 (2021) e07840
Fig. 2. Obstacle’s location w.r.t. the swarm: Centered =Obstacle’s center is in
the same as the swarm’s center, Left Shifted =Obstacle is shifted towards left
side from the center of the swarm, Right Shifted =Obstacle is shifted towards
right side from the center of the swarm.
population causes an increase in overall time for the swarm to reach
the destination and an associated increase in the energy consumption
of the agents. The congestion-aware distribution methodology proposed
in this paper works by forcing some of the agents (encircled by a gray
circle) to opt for the longer distance in order to find the optimal solution
for the swarm. As shown in Fig. 2and elaborated in Section 5, choos-
ing collision avoidance maneuvers that focus on time minimization of
the swarm as a whole is a more effective method.
When a swarm of autonomous drones encounters an obstacle(s), the
agents take local decisions to perform collision avoidance maneuvers.
Fig. 3shows an example scenario of a swarm with eight agents avoiding
an obstacle using the two different approaches. The initial configuration
is illustrated by agents in “blue” (Fig. 3(a)). The cases illustrated are
as follows: 1) swarm in distribution while performing collision avoid-
ance using shortest path approach (Fig. 3(b)), 2) the distribution of the
swarm agents with the proposed approach (Fig. 3(c)). The apparent
answer to the collision avoidance problem is for each drone to select
the nearest end of the obstacle and go round the corner as the opti-
mum route, namely: the shortest path approach [38]. As exemplified
in the aforementioned figure, the optimal formation disturbance for the
swarm may not follow the shortest path rule, for example in Fig. 3(b)
if each agent moves towards the edge of the obstacle with respect to
its own coordinates to follow the shortest path, it will take more time
for the swarm to bypass the obstacle since the agents will have to slow
down to avoid congestion from neighboring agents. On the other hand,
if the agents follow the proposed optimal morphing configuration, illus-
trated in
3(c), the swarm distribution is done in a manner to minimize
the overall time penalty. In order to avoid the congestion and resultant
delays, some of the agents are directed to choose longer routes in order
to minimize the overall time taken by the swarm to pass the obstacle.
The main motivation behind the proposed approach comes from the
hypothesis that the selection of avoidance route may apparently be the
shortest path whereas it may not be optimal when considering a time-
aware objective function. Therefore, the problem is how to avoid the
obstacle in an efficient way, i.e., to minimize the overall time required
by the swarm to perform an avoidance maneuver, without increasing
the velocity significantly, i.e., aggressive acceleration. For example, for
an individual agent selecting the nearest edge to bypass the obstacle
may be optimum, but for the swarm as a whole, it may not be. This
is due to the fact that delays occur when the swarm has to deviate
from its original trajectory to either avoid an obstacle or go through
the available gap between the obstacles and the agents have to slow
down, wait, or allow for other neighboring agents to go ahead or merge
in the queue as shown in Fig. 3(b). Now it is important to note here
that if an obstacle, assuming the obstacle is in detection range and both
corners are visible, clearly extends towards one side of the swarm does
not mean that going for the shortest path will provide optimal results,
i.e., the minimum time for the last agent to pass through. Here we are
calculating the time from when the obstacle is detected till the last agent
passes the center of the obstacle, which is our cost function.
To support this claim, we investigate three different scenarios where
a swarm faces an obstacle in its way: the first scenario is when the
obstacle is in line with the center of the swarm, the second is when the
obstacle is to the left of the swarm, and the third is when the obstacle
is to the right of the swarm. Fig. 2shows the timing result of these
three scenarios. Here, the agents are divided into two groups, namely:
Group N1 deviates towards the left corner and Group N2 deviates to
the right corner as shown in Fig. 5. In this case, the swarm is composed
of 8 agents, in a nested V-shaped formation as shown and the results
are reported for: 1) Centered, when the obstacle’s center is inline with
the center of the swarm, the optimal result obtained is when N1 and
N2 both have 4 agents, it took the swarm 53 sec to pass the obstacle
(as shown in Fig. 2), 2) Left Shifted, when the obstacle’s center is shifted
to left side w.r.t. the swarm’s center, the optimal result was acquired
with 3 agents in N1 and 5 agents in N2, and 3) Right Shifted, when the
obstacle’s center is shifted to right, the optimal timing for bypassing the
obstacle is obtained, i.e., 𝑡𝑚𝑖𝑛 =56s with 5 agents in N1 and 3 agents in
N2.
It is important to note here that even though it might be possible
to reduce the delays by accelerating aggressively to minimize the time
delay, however, it has an adverse effect on the power consumption of
the agent as the minimum power requirement changes [39]. Therefore,
in the performed simulations, the agents maintain a nominal velocity
of 𝑣𝑖whenever possible and are allowed to accelerate/decelerate only
gradually.
4. Proposed approach
In this section, we describe the proposed Swarm Formation Morph-
ing for Congestion Aware Collision Avoidance algorithm for a swarm of
autonomous agents; a simplified system flow diagram is given in Fig. 4.
The overall strategy is to combine the optimal formation morphing, in
the presence of obstacles, to avoid overpopulation and the reformation
mechanism that facilitates efficient navigation of the swarm, see Fig. 5.
In the optimal formation morphing for avoidance maneuver, based on
the number of obstacles, the population factors are evaluated for the
agents of the swarm. Then using the population factor and the time
these factors require for avoidance completion, agents are divided into
different sets of groups. These set of groups of agents nominate their
own respective local leaders of the groups. Once the obstacle avoidance
is successfully completed, the swarm formation is in a highly disturbed
state. Next, in the convergence phase, thin-plate splines based reforma-
tion methodology is used for bringing the agents back into the intended
formation. Here, based on the position vectors, agents are mapped onto
the desired formation positions in an optimal manner.
Now, the detailed working of the proposed approach is presented.
It is assumed that, initially the swarm in flying in the desired for-
mation shape and the communication amongst the agents is already
established. Algorithm 1highlights the overall routine of the proposed
approach. This top-level algorithm is executed by each agent locally, by
utilizing its onboard processing unit. Algorithm 1starts by checking and
setting up the leader for the swarm and then proceeds to connect the fol-
lower agents with their respective leaders if it has not been established
yet (Line 2). Then based on the current state, i.e., position, of each
agent in the swarm, the 𝑇𝑎𝑟𝑔𝑒𝑡_𝑆ℎ𝑎𝑝𝑒 of the swarm is decided (Line 3)
and target coordinates for each agent are calculated. Here 𝑇𝑎𝑟𝑔𝑒𝑡_𝑆ℎ𝑎𝑝𝑒
represents the intermediate shape of the formation to be attained at the
end of each iteration on the way to reach the desired final formation.
After initialization, the main loop begins (Lines 4-8), where Obstacle
Detection is the first procedure that is executed (Line 4). In case, an ob-
stacle is in the detection range, a certain set of rules are executed (Lines
5-7). First the procedure Grouping Process() is called. This procedure is
responsible for determining the optimal formation morphing configura-
tion. By utilizing the information provided by Obstacle Detection(), i.e.,
the number of obstacles, this procedure calculates the population fac-
tors and the respective times they require to go past the obstacle, then
3
J.N. Yasin, M.-H. Haghbayan, M.M. Yasin et al. Heliyon 7 (2021) e07840
Fig. 3. Swarm encountering obstacle (a) the initial configuration, (b) shortest path swarm distribution, (c) swarm distribution utilizing the proposed approach.
Fig. 4. Simplified finite state machine of the congestion aware collision avoid-
ance.
Fig. 5. Illustration of 3 phases: Phase 1) the initial phase, Phase 2) system at
highest disturbance point, Phase 3) the convergence phase.
Algorithm 1 Global Routine.
1: procedure OBSTACLE DETECTION & NAVIGATION()
2: Leader follower ID assignment;
3: Target_Shape Initialize w.r.t. current state;
4: while (𝐷𝑒𝑡𝑒𝑐𝑡𝑖𝑜𝑛, 𝑑𝑜, 𝐷𝑧𝑜𝑛𝑒) Obstacle Detection() [𝐷𝑒𝑡𝑒𝑐𝑡𝑖𝑜𝑛]do
5: Grouping process();
6: Leader assignment in local groups;
7: Collision avoidance();
8: end while
9: Reformation();
10: end procedure
the optimal solution is chosen. Next, based on the aforementioned cal-
culations and leader determination from the Grouping Process, leader
assignment is done (line 6). Then the procedure Collision Avoidance is
called to guide the agents reliably and safely away from the potential
collisions (Line 7). Finally, the reformation procedure based on thin-
plate spline is called to bring the agents back into the desired formation
(Line 9). Its effect is only significant in case the formation has been
distorted because of collision avoidance. The utilization of point set
Algorithm 2 Obstacle Detection.
1: procedure OBSTACLE DETECTION()
2: if 𝑂𝑏𝑠𝑡𝑎𝑐𝑙𝑒 in 𝐷𝑒𝑡𝑒𝑐𝑡𝑖𝑜𝑛𝑅𝑎𝑛𝑔𝑒 then
3: 𝐷𝑒𝑡𝑒𝑐𝑡𝑖𝑜𝑛 =True;
4: 𝑑𝑜Calculate the distance and angles to the obstacle;
5: 𝐷_𝑧𝑜𝑛𝑒 calculate the danger zone;
6: end if
7: end procedure
Fig. 6. Obstacle Detection.
registration in the reformation process is of particular significance as it
is vital to do the mapping between the current and the expected shapes
optimally and swiftly.
4.1. Obstacle detection
The pseudo-code for this procedure is specified in Algorithm 2, in
which the agent scans for the presence of any objects continuously and
the moment an object is detected by the onboard sensor system, the
𝐷𝑒𝑡𝑒𝑐𝑡𝑖𝑜𝑛 flag is set to True (Lines 2-3). Then based on the sensor’s feed-
back, the calculation of the detected object’s parameters is done, i.e.,
the distance at which the object is detected and the angle to it (Line 4),
as shown in Fig. 6.
Considering the velocity at which the agent itself is traveling and
the distance to the detected obstacle, the danger zone is defined, be-
yond which the collision is imminent and can not be avoided (Line 5).
The danger zone is defined to adjust the velocities of the agents appro-
priately based on the stopping distance of the agent, as elaborated in
the equations below. We know the distance to the obstacle and the ve-
locity of the agent, then the time to potential impact 𝑡𝑖𝑚𝑝 is calculated
by:
𝑡𝑖𝑚𝑝 =𝑑𝑜𝑖𝑣(1)
where 𝑑𝑜𝑖 is the distance to the object(s) and 𝑣is the agent’s veloc-
ity. The distance that an agent will travel after detecting the obstacle
and before it comes to a complete halt, called the stopping distance, is
composed of two parts. Firstly, the distance it continues to travel while
obstacle detection and avoidance algorithm is executing; this duration
is called the reaction time and the distance so traveled is called the re-
action distance. Secondly, the distance it covers while decelerating to a
4
J.N. Yasin, M.-H. Haghbayan, M.M. Yasin et al. Heliyon 7 (2021) e07840
complete stop, referred to as the braking distance. Therefore, the stop-
ping distance is computed as follows:
𝑑𝑠=𝑑𝑟+𝑑𝑏(2)
Where 𝑑𝑠, 𝑑𝑟, and 𝑑𝑏are the stopping distance, reaction distance, and
braking distance respectively. Braking distance (𝑑𝑏) and reaction dis-
tance (𝑑𝑟) are calculated as follows:
𝑑𝑏=𝑣2∕2𝑔𝑐𝑑(3)
𝑑𝑟=𝑣𝑡𝑐(4)
Where 𝑔is the gravitational constant, 𝑐𝑑is the air drag coefficient, and
𝑡𝑐is the time it takes to compute or react.
4.2. Grouping process
In this process, specified in Algorithm 3, the leader approximates by
simulating the time to avoid the obstacle(s) for all the combinations of
the agents by utilizing their respective velocities and coordinates. The
number of obstacles ({obsSet}), in the vicinity, is used to calculate the
population factor set ({popfacSet}), Line 2 in Algorithm 3. For instance,
if there is one obstacle, then the population factor is two, since there
are two possible paths for the agents to navigate through. The available
number of population factors can be defined by the following relation:
𝑝𝑓𝑖=𝑜𝑏𝑠𝑖+1 (5)
where 𝑝𝑓𝑖is the number of population factor and 𝑜𝑏𝑠𝑖is the number of
obstacles. Then based on the population factor set and the penalty of
time, i.e., the group configuration that requires the minimum amount
of time to pass the obstacle, the agents are divided into different groups
({groupSet}) is calculated (Line 3), as illustrated in Fig. 3. The agents’
distribution into the {groupSet} is done based on the following metric:
𝜏=Σ𝐷𝑖
𝑣𝑖𝐽
(6)
𝜏is the overall time, Σ𝐷is possible paths based summation of the dis-
tance from agent’s current location to estimated avoidance location, 𝑣𝑖
is the velocity of the agents, 𝐽is the number of agents. Where 𝐷𝑖is
𝐷𝑖=𝑓𝐺𝑖(𝑑𝑔𝐺𝑖)(7)
𝑓𝐺𝑖 is the geometric median of the group 𝐺𝑖, 𝑑is the average dis-
tance of the agents from each other, 𝐺𝑖is the groupSet. The relation
between the 𝑑to population factor, i.e., 𝑝𝑓𝑖is
𝑑∝1𝑝𝑓𝑖(8)
and the relation between 𝑝𝑓𝑖and 𝑠𝑎𝑓 𝑒_𝑑𝑖𝑠𝑡𝑎𝑛𝑐𝑒, i.e., the defined safe
distance to be maintained amongst the agents and the velocities is given
as
𝑝𝑓𝑖∝1safe_distance (9)
𝑣𝑖∝1𝑝𝑓𝑖(10)
Afterwards, {leaderSet} gets the leaders determined from the respective
calculated groups, i.e., {groupSet} (Line 4). In each group set, electing
group leader within that group provides the same functionality as that
of the swarm leader, as it may be required to divide the group into
further sub-groups to avoid congestion, in case the group encounters
further obstacles.
Algorithm 3 Grouping Process.
1: procedure GROUPING PROCESS()
2: {𝑝𝑜𝑝𝑓 𝑎𝑐𝑆 𝑒𝑡}Calculate population factor ({𝑜𝑏𝑠𝑆𝑒𝑡});
3: {𝑔𝑟𝑜𝑢𝑝𝑆 𝑒𝑡}group ({𝑝𝑜𝑝𝑓 𝑎𝑐𝑆 𝑒𝑡});
4: {𝑙𝑒𝑎𝑑𝑒𝑟𝑆𝑒𝑡} determine leader ({𝑔𝑟𝑜𝑢𝑝𝑆𝑒𝑡});
5: end procedure
Algorithm 4 Collision Avoidance.
1: procedure COLLISION AVOIDANCE()
2: while 𝑑𝑜< 𝐷𝑒𝑡𝑒𝑐𝑡𝑖𝑜𝑛𝑅𝑎𝑛𝑔 𝑒 do
3: if obstacle number >1then
4: 𝑔𝑎𝑝 calculate the distance between obstacles;
5: if 𝑔𝑎𝑝 > 𝑑𝑖𝑠𝑡𝑠𝑎𝑓𝑒 then
6: path planning(edges); agent is aligned w.r.t. the gap
7: end if
8: else
9: 𝑝𝑙𝑎𝑛 single obstacle;
10: path planning(plan); single obstacle scenario
11: end if
12: end while
13: 𝐷𝑒𝑡𝑒𝑐𝑡𝑖𝑜𝑛 =False;
14: end procedure
4.3. Collision avoidance
The pseudo-code, in Algorithm 4, describes the collision avoidance
procedure. This procedure is executed when the obstacle is detected and
the calculated distance and angles suggest that continuing the trajectory
will lead to a collision. It starts by checking if there were multiple ob-
stacles detected (Line 3). In case, the detected obstacles are more than
one, the available gap between the obstacles is then calculated (Line 4).
If the gap is greater than the defined minimum safe distance (minimum
allowed distance on either side of the agent plus agent’s dimensions),
the agent is aligned to navigate through the obstacles (Lines 5-6). Other-
wise, the obstacles are enveloped as one obstacle, and path planning is
done accordingly to bypass a single obstacle. In case only one obstacle
was detected initially, path planning is performed, for a single obsta-
cle, to bypass the obstacle (8-10). For aligning the agent to navigate
through the gap between the obstacles and path planning, we utilized
and implemented the technique presented in [40]. If the distance to the
obstacle is no longer in the detection range, the control is returned to
the overall routine by resetting the Detection flag to False.
4.4. Reformation
We take inspiration from the technique presented in [10] and base
the reformation function by utilizing point set registration [41, 42]
that is based on a well known technique used to data interpolation
and smoothing issues, i.e., thin-plate splines (TPS) [43]. The amount
by which the formation is distorted is assessed by the energy function
as shown in Eq. (6).
𝐸𝑇𝑃𝑆(𝑓)=
𝑛
𝑖=1 ||𝑥𝑖𝑓(𝑣𝑖)||2+
𝜆[( 𝜕2𝑓
𝜕𝑥2)2+2( 𝜕2𝑓
𝜕𝑥𝜕𝑦)2+(𝜕2𝑓
𝜕𝑦2)]𝑑𝑥𝑑𝑦
(11)
Where 𝐸𝑇𝑃𝑆 is the energy function and 𝜆is the scaling factor. Map-
ping a set of points to the corresponding point sets while keeping the
intended formation under consideration, is handled by the integral part
of the equation. Since, our intention is to only map one set of points over
the other and without considering the distorted shape of the swarm,
therefore in order to map the closest points we set the scaling factor (𝜆)
to zero. This reduces the Eq. (11)as follows:
𝐸𝑇𝑃𝑆(𝑓)=
𝑛
𝑖=1 ||𝑥𝑖𝑓(𝑣𝑖)||2(12)
It is important to note here that the TPS algorithm is not generating
the control velocities, but generating the next/future coordinates for
5
J.N. Yasin, M.-H. Haghbayan, M.M. Yasin et al. Heliyon 7 (2021) e07840
Algorithm 5 Reformation.
procedure REFORMATION()
2: while Agents have not REACHED new coordinates do
𝑁𝑒𝑥𝑡_𝐿𝑜𝑐𝑎𝑡𝑖𝑜𝑛 =Compute the next position of the swarm;
4: 𝐴𝑔𝑒𝑛𝑡(𝑖)=Compute new coordinates for each agent;
TPS(𝑁𝑒𝑥𝑡_𝐿𝑜𝑐𝑎𝑡𝑖𝑜𝑛); Minimization of temperature func.
6: end while
end procedure
the agents to navigate to. Then based on those, the agents draw their
respective tangents and adjust their respective velocities.
The overview of the TPS-based reformation function is provided in
Algorithm 5. This procedure starts by computing the next, i.e., the fu-
ture, location of each agent based on the present coordinates of the
agents (Line 3). Then agents are assigned new coordinates based on
the determined new location (Line 4). Then, to perform reformation as
optimally as possible, these determined values are passed to the tem-
perature minimization function based on TPS, for bringing the agents
to their respective updated locations as optimally as possible (Line 5).
As soon as every agent has reached its respective new location or coor-
dinates, the control is returned to the overall routine.
The main issue to discuss about the complexity is the convergence
of the algorithms. As it can be noticed in Algorithm 1, the algorithm
repeats the evaluation and action process until an obstacle is in the
range of the swarm agents. Most parts of other algorithms are simple
conditional statements in the form of if-then-else with complexity 𝑂(1)
and the nodes are performing in parallel the computations individually.
Moreover, some parts of the algorithm can be executed pro-actively,
such as the pre-evaluation part in the collision avoidance algorithm.
The complexity for the grouping process is 𝑂(𝑛), where 𝑛is the number
of nodes in the swarm. Here, the leader has to do estimation analysis
to find the optimal distribution solution for all nodes. The complexity
of the proposed approach relies on the presented algorithms as follows:
Algorithm 1, Algorithm 2, Algorithm 4, and Algorithm 5have the com-
plexity of 𝑂(1). Whereas, Algorithm 3, i.e., grouping process, has the
complexity of 𝑂(𝑛), where 𝑛is the number of nodes in the swarm. It is
worth mentioning that since the algorithm will be triggered only when
the swarm is facing an obstacle and when the swarm is progressing, the
velocities of the nodes toward the mission path never reaches zero. It
effectively means that the algorithm never enters an endless loop and
will end when the swarm passes the obstacle, even when the algorithm
is not computed entirely. In such cases, i.e., when the algorithm does
not have enough time to optimize in the base applicable way, the swarm
will avoid and pass the obstacles with some penalty of power, i.e., some
expected power saving by the algorithm will be lost.
5. Experimental setup
For simulating agents in the swarm, point mass particle model and
the point mass particle’s equations of motion are utilized. SwarmLab, a
MATLAB Drone Swarm Simulator [44], is used for evaluating the pro-
posed idea. The communication module for each drone, to evaluate
the power, is Legacy Digi XBee-Pro S1 802.15.4, owing to the possi-
bility of connecting large number of devices and its longer transmission
range, i.e., 100 m urban/indoor environment, and data rate of 250 kbps.
The power consumption in Transmitting Mode and Receiving Mode is
710 mW and 182 mW respectively [45]. The consumption due to the
use of ranging sensor, for sense and avoid function, is evaluated based
on the consumption of Velodyne Puck LITE, i.e., 8 Watts typically [46].
Assumptions and initial conditions considered in this work are de-
fined as follows:
1. all drones are at the same altitude
2. agents accelerate or decelerate linearly
3. the position vectors of the agents are obtained by utilizing on-board
localization techniques
4. the communication channel is ideal, i.e., without information loss
and delays
5. the computational or reaction time of the agent is considered to be
negligible, and the reaction distance (𝑑𝑟) is zero.
6. Simulation & results
The mission starts with agents already in a defined nested V-shaped
formation moving towards the destination in an open environment.
Fig. 7(a) shows the disturbed formation at Simulation time =25 s when
the obstacle has been detected and the agents have started deviating
to avoid the potential collision, i.e., the first layer. In Fig. 7(b), the
formation disturbance is at maximum, the agents, grouped to avoid
congestion on either side (N1, N2)1while keeping the minimum safe
distance from the obstacle and from each other, are bypassing the obsta-
cle. As soon as the agents pass the obstacle, the second set of obstacles
is detected by both groups locally. As shown in Fig. 7(c), the agents di-
vide themselves locally into further sub-groups (we call N11, N12 and
N21, N22 for subgroups from N1 and N2 respectively) to avoid con-
gesting either side. The agents in N12 and agents in N21 are navigating
towards the same route to bypass the obstacles. In this case, the agent
farthest ahead takes precedence and in a similar manner, they merge to
form a queue formation to navigate through space between the obsta-
cles. Fig. 7(d), shows the swarm’s reformation once there is no obstacle
in the detection range of the agents. The trace for the overall move-
ment of the agents throughout the mission is shown in Fig. 8, where
morphing of the formation is visible, through a forest-like environment.
In the figure, the starting points/positions of the agents are denoted by
a “diamond” shape and the final positions are denoted by a solid circle.
Fig. 9shows the average velocity of the swarm as a whole, Fig. 10
shows the average distance maintained by the agents in the swarm;
the standard deviation of the velocity and distance is also plotted for
reference. The non-aggressive variance in the average velocity is due
to the fact that agents have to slow down to provide enough space for
another agent, deviate to bypass the obstacle, slow down if the agent in
front is slowing down (Fig. 7(b)), and maintain tight queue formation
while going through obstacles.
In Fig. 10, the solid red line shows the defined minimum safe dis-
tance in the performed experiment, which is the minimum distance
agents maintain with each other in the disturbance phase, i.e., while
performing collision avoidance. The peak at around t=43 s, is due to
the change in immediate respective leaders due to the grouping process,
Fig. 7(b). The second sudden change in the average distance main-
tained, at t=66 s, is due to the encounter with the second set of
obstacles and the previous groups getting divided into further groups
and the resultant change in immediate leaders through grouping process.
From around t=80 s onwards, the agents are coming back into the
desired formation shape and maintaining the formation defined inter-
agent distance. There is a negligible error of 0.8 m in the average dis-
tance maintained between the agents when reformation is completed.
To evaluate the effectiveness of the proposed technique, we imple-
mented the well-known techniques of shortest path based formation
morphing and collision avoidance (EFMCA) and leader-follower forma-
tion (IOAA) presented in [10] and [14] and set the results side by side
with the obtained results from the proposed technique in the similar
experimental setup. Here we evaluate the performance in two different
setups: normal and complex. The normal complexity scenario is illus-
trated in Fig. 1, where the swarm encounters one layer of obstacles,
i.e., three obstacles parallel to each other, and the high complexity sce-
nario is shown in Fig. 7, where the swarm encounters nested obstacles
and navigates through them.
1Group labeling is done for illustration and explanation purposes. Depending
on the scenario, agents can be divided into several groups and subgroup sets
{groupSet}.
6
J.N. Yasin, M.-H. Haghbayan, M.M. Yasin et al. Heliyon 7 (2021) e07840
Fig. 7. Simulation snapshots. (a) time =25 s of the simulation. (b) time =50 s of the simulation, swarm navigating through the obstacles. (c) time =70 s, groups
divided into further subgroups upon encountering another set of obstacles (d) towards end of simulation.
Fig. 8. Trace of Overall Movement of the Agents. Here starting locations of all
the agents are represented by the diamond shape () and the final locations of
the agents are represented by a dot shape ().
Fig. 9. Report of the average Velocity, average ±standard deviation of the
swarm.
Fig. 10. Average distance maintained by the agents from mission start to obsta-
cle avoidance to mission end, average ±standard deviation of the swarm.
Firstly, Fig. 11, show the overall trend of the agents while navigating
through the set of obstacles while utilizing three different methodolo-
gies. Figs. 11(a), 11(b), and 11(c) show the trajectory traces of the
agents, in the normal complexity scenario (single layer of obstacles)
while utilizing the IOAA, EFMCA, and congestion-aware techniques re-
spectively. As the figures show, maximum delays due to congestion
occur in Fig. 11(a) and 11(b), and it took the swarm to get back
into formation t=115 and t=110 s respectively. Whereas, in 11(a)
congestion is minimized by employing the proposed technique and
subsequently, the agents manage to maintain the desired formation
shape after avoiding the obstacles at t=80 s. Correspondingly, Fig. 12
shows the average velocity and distance maintained by the swarm as
a whole during the mission. The delays due to congestion and as a
consequence the variation in the average velocity of the swarm is no-
ticeable in Figs. 12(a) and 12(b), whereas, in comparison it can be
seen in Fig. 12(c), average velocity and minimal variance, the proposed
congestion-aware approach outperforms the mentioned methodologies.
The average distance maintained by the agents with their respective
leaders is shown in Figs. 12(d), 12(e), and 12(f). Here, in 12(d) (IOAA)
and 12(f) (congestion-aware approach), the distance maintained and
the variance is quite linear and closer to the desired defined distances
between the agents. However, in 12(e) (EFMCA), due to the fact that
agents can break away from formation for their personal benefit, i.e.,
shortest path avoidance, variance in the distance between the agents is
much higher.
Similarly, Figs. 11(d), 11(e), and 11(f) show the overall trajectories
of the agents while navigating through the nested layers of obstacles,
i.e., high complexity scenario. The first set of obstacles are shifted down
relative to the center of the swarm, as illustrated in Fig. 5. As can be
seen from Fig. 11(d), that the swarm while utilizing only the leader-
follower based approach faces the maximum congestion while navigat-
ing through the obstacles. Since the agents just follow their leader(s)
and maintain the desired safe distances to avoid colliding with each
other, they have to slow down, hover at their respective locations to al-
low other agents to merge in the queue while morphing the shape for
navigating through the obstacles. Fig. 11(e), shows the movement trace
of the agents while utilizing the shortest path approach for collision
avoidance. As can be seen, besides agent 5, all other agents have their
shortest path towards the same gap. This leads to maximum congestion
as well. Fig. 11(f) shows the overall behavior of the swarm while uti-
lizing the proposed congestion-aware approach. The setup is the same
as the above setups with all agents, except agent 5, having their short-
est paths towards the same gap between the obstacles. However, while
utilizing the proposed approach, agents 3 and 8, are forced to take the
distance penalty in order to get the most optimal solution for the swarm
as a whole, i.e., minimum congestion.
Fig. 13 shows the average velocity of the swarm and the average
distances maintained by the agents with their respective leaders, from
mission start till the agents come back to the desired formation shape
while employing the proposed approach in comparison with the men-
tioned approaches. As can be seen from Fig. 13(a) the average velocity
maintained by the swarm as a whole has major deviations due to the
fact that while using only the leader-follower based queuing approach
[14], all the agents navigate through the same narrow gap available
between the obstacles, resulting in maximum congestion. This forces
all the agents to slow down in order to allow other agents to come
into the queue while morphing the formation. Moreover, as shown
in Fig. 13(b), while utilizing the leader-follower based approach inte-
grated with shortest path avoidance maneuvers [10], the deviation in
the average velocity is almost the same as in the previous case with
the exception of one agent (UAV 5, shown in Fig. 11(e)). Here the UAV
5 is the only agent that has the shortest path towards a different gap.
Whereas, as shown in Fig. 13(c), the swarm’s overall velocity remains
approximately at the desired/optimal velocity even while navigating
through the obstacles. This is due to the fact that, upon utilizing the
7
J.N. Yasin, M.-H. Haghbayan, M.M. Yasin et al. Heliyon 7 (2021) e07840
Fig. 11. Traces of the overall movement while utilizing three different approaches. Trend of agents’ trajectories utilizing (a) leader-follower based approach while
navigating through single layer of obstacles, maximum congestion; (b) shortest path approach while navigating through single layer of obstacles, one agent deviates
to its respective shortest path, otherwise maximum congestion; (c) the proposed congestion-aware scheme while navigating through single layer of obstacles,
minimum congestion; (d) leader-follower based approach while navigating through nested layers of obstacles, maximum congestion; (e) shortest path approach
while navigating through nested layers of obstacles, one agent deviates to its respective shortest path, otherwise maximum congestion; (f) the proposed congestion-
aware scheme while navigating through nested layers of obstacles, minimum congestion.
Fig. 12. Normal setup scenario comparison of average velocity and distance maintained by the agents, while employing the mentioned three approaches, in the
swarm from the start of the mission, while navigating through the obstacles, and towards the end of the mission ±standard deviation.
congestion-aware estimation, the leader of the swarm forces two agents
(UAV 3 and 8, shown in Fig. 11(f)) to take distance penalty in order to
achieve the optimal solution for the swarm.
Similarly, the average distances maintained by the agents with their
respective leaders, is shown in Figs. 13(d), 13(e), and 13(f). Average
distances between the agents in [14] and [10] are much higher as com-
pared to the distances maintained while utilizing the congestion-aware
approach. This is simply due to the delays that occur due to overpop-
ulation while navigating through the obstacles. Whereas, as shown in
Fig. 13(f), the only time the average distance has an exponential peak
(at around t=60 s) is during the reformation phase and due to the
change of the respective leaders. During all the performed experiments,
the average distance never went below, i.e., crossed, the safe distance
line, meaning that no collisions occurred in any of the setups. It is
important to note here, that with [10] and [14] approaches, due to
congestion, the overall time for the swarm to come back into formation
increased significantly, and the leaders, upon arriving at their respective
coordinates, slowed down to allow the remaining followers to approach
them without accelerating aggressively. Velocity change behavior of in-
dividual agents/UAVs throughout the mission while employing [10],
[14], and the proposed congestion-aware techniques can be analyzed.
In Figs. 14 and
15, it can be clearly seen that due to the overpopulation
and congestion, several of the agents decelerated to 0 m/s, i.e., came
to hovering state, and wait for their turn while creating space for other
agents in the swarm to merge in the queue. Whereas it is evident from
Fig. 16, since the proposed methodology takes the measures for mini-
mizing congestion, none of the UAV came to hovering state to wait for
its turn, only UAV 7 decelerated to 2 m/s, and the overall trend of the
UAVs on average is much closer to the optimal navigational velocity.
Therefore, utilizing the congestion-aware approach the swarm comes
8
J.N. Yasin, M.-H. Haghbayan, M.M. Yasin et al. Heliyon 7 (2021) e07840
Fig. 13. High complexity scenario comparison of average velocity and distance maintained by the agents, while employing the mentioned three approaches, in the
swarm from the start of the mission, while navigating through the obstacles, and towards the end of the mission ±standard deviation.
Fig. 14. IOAA - High complexity [14].
Fig. 15. EFMCA - High complexity [10].
Fig. 16. Congestion-aware - High complexity.
back to the desired formation shape, after evading all the obstacles, in
approximately half the time it takes for the other two approaches. More-
over, the deviation in their velocities with [10] and [14] is also higher
as compared to deviation while utilizing the proposed technique.
In order to estimate the energy-saving effect of the proposed ap-
proach, we first consider the energy consumption of the swarm of eight
drones while bypassing a single obstacle, as discussed in section 2and
depicted in Fig. 3. In the following discussion, we use the results of [47],
Fig. 17. MIN =minimum energy consumed by an individual UAV, MAX =max-
imum energy consumed by an individual UAV, and Total energy consumption
of the swarm for all techniques in normal complexity and high complexity en-
vironmental scenarios.
where total power required by a drone weighing 20 Newton, having
four blades with a rotor radius of 40 cm is plotted against the drone’s
flying speed. We have selected the nominal speed as 10 m/s, which
is a close approximation of the Maximum Endurance speed calculated
by [47]. To further enhance endurance, we perform gradual accelera-
tion and deceleration with maximum speed fixed at 20 m/s, the power
consumption is seen to rise drastically at speeds above this value, as in-
dicated in Fig. 2 of [47] and validated within statistical bounds by [48]
after extensive experimentation. The total energy consumed to perform
a maneuver can be found by integrating the instantaneous powers over
the whole flight time, from the start time (𝑡𝑠) to the finish time (𝑡𝑓).
Since our algorithm works in discrete time steps, we calculate each
drone’s total energy consumption as shown in Eq. (13), and sum up
individual results to yield the total energy consumption of the swarm
as a whole.
𝐸𝑡𝑜𝑡𝑎𝑙 =
𝑡𝑓
𝑡=𝑡𝑠
𝑃(𝑡𝑡(13)
Fig. 17 shows the comparison between the energy consumption of
the swarm as a whole for all three experiments in two different com-
plexity levels of the environment. In the normal complexity scenario,
with the proposed scheme, the swarm utilized 80.25 kJ from mission
start till the agents come back into the intended formation shape after
bypassing the obstacles, whereas, employing the traditional approaches
IOAA and EFMCA, the swarm consumed 123.34 kJ and 120 kJ respec-
tively. Moreover, employing the proposed approach and bypassing the
9
J.N. Yasin, M.-H. Haghbayan, M.M. Yasin et al. Heliyon 7 (2021) e07840
set of obstacles in high complexity scene, the total energy consumed
by the swarm was 110.26 kJ, resulting in 56.11% and 51.8% lower en-
ergy consumption as compared to the traditional approaches, i.e., the
shortest path method and leader-follower queuing, where the swarm
consumed 196.49 kJ and 212.63 kJ respectively.
7. Conclusions
In this paper, we present a methodology for finding an optimal
solution to (1) avoid the congestion that may happen in a swarm of
autonomous agents while avoiding collisions with obstacles and to (2)
bring the agents back into the desired formation shape after evading
an obstacle. In the proposed method, an agent population control fac-
tor is considered in relation to the obstacle(s) in the vicinity, with a
time constraint for the disturbance phase. In this approach, the leader
of the swarm takes a centralized decision by utilizing the parameters of
the agents (coordinates, velocities) and obstacles to find the population
factor, and based on that the grouping configuration of the swarm is de-
termined. Then it selects the group setup which provides the shortest
overall congestion delay. Afterwards, in the convergence phase of the
proposed methodology, thin-plate splines based technique is utilized to
optimally bring the agents back into the intended formation by map-
ping the closest agents to the nearest points of the desired formation.
We demonstrated via simulations that by utilizing the congestion con-
trol approach we