Abstract
Over the years, control of autonomous vehicles in a defined formation has been the subject of much research. Albeit leader-follower approach being one of the most used in formation control, it suffers a major practical drawback of leader failure while cruising in formation. In this work, we aim to solve this problem by proposing a novel assignment algorithm that assigns a new leader from the follower robots to ensure robots complete their given task when their leader fails. This algorithm also assign role to new robots joining the group, as well as the failed robot when rescued back to the team. We drive robots towards their desired trajectories to achieve formation using a Lyapunov-based time-varying state tracking controller from the literature. Due to role switching amongst member robots, we propose a new variant of the limit-cycle obstacle avoidance algorithm to ensure smooth and collision free transition. Simulations and experiments are performed using the robot operating system framework due to its flexibility to verify the effectiveness and reliability of the proposed algorithms.
Introduction
Control of multi-robot systems has attracted much research in recent years owing to its potential for solving problems that are difficult or nearly impossible for a single robot. Formation control is one of the common areas where multi-robot systems are involved. In this scenario, two or more robots move to a desired posture to attain formation or move in a defined shape to a desired destination.1–3
Depending on the sensing capabilities and the interaction topology of the robots, a variety of formation control problems have been studied in the literature. Some of these problems include flocking, estimation-based control, pure distance-based control, angle-based control, containment control, and cyclic pursuit, among other formation control strategies. 4 Depending on whether or not the desired formation is time varying, formation control problems are generally divided into two; namely, formation generating problems and formation tracking problems. In their review, Oh et al. 4 described how the existing literature has addressed each of these problems. Formation generating problem refers to the situation in which the collective objective of the agents is to achieve a prescribed desired formation shape. Formation tracking problem, on the other hand, refers to the case in which the agents are controlled to track some prescribed reference trajectory. Both these problems have been addressed in the literature using a variety of tools, including matrix theory based approach, Lyapunov based approach, graph rigidity approach, potential fields approach, receding horizon, among other approaches. 5
Formation tracking problems have been used in multiple applications and have, therefore, received a great deal of attention. Beard et al. 6 and Scharf et al. 7 classified the formation tracking problems into leader-follower, behavioral-based, and virtual structure approaches. The leader-follower approach has gained more attention due to its simplicity, reliability, and no need for global knowledge. 8 In this strategy, a leader robot is selected to determine the motion of the whole group and serves as a reference for the other follower robots. Each follower robot maintains a desired relative position with respect to its leader. When the motion of the leader is known, desired trajectories for the follower robots are generated by the leader relative to its posture. A tracking controller is designed for each follower robot to achieve formation. Therefore, in some sense, the leader-follower formation control problem can be regarded as a natural extension of the traditional trajectory tracking problem. 8
The major practical drawback of leader-follower strategy is leader failure. 3 Indeed, since the leader-follower consists of following the leader, leader failure results in failure of the whole group to maintain formation or move to the desired destination. To the best of our knowledge, very few works explicitly address this problem, despite the abundance of literature on the subject. According to Besseghieur et al., 8 leader failure is addressed by dynamically changing the leadership of the team manually form a dedicated workstation, and switching to a linear formation to avoid obstacles. However, total failure of the leader is not considered, and the possibility of collision between robots during role transition is another problem.
In this work, our main objective is to present a novel approach that will enable follower robots to overcome the problem of leader failure in a practical setting. The main contributions of this article are as follows:
We propose an algorithm that assigns a new leader from the follower robots in case of leader failure. The algorithm enables other follower robots adjust their roles in the team to follow the new leader, and assign a new role to the failed leader when we are able to launch it back to the team. To ensure robots do not collide with one another or with a static obstacle during role transition, we proposed a new approach to the limit-cycle obstacle avoidance algorithm by Adouane,
9
Mouad et al.
10
to enable the use of this avoidance strategy in trajectory tracking applications. We consider the case where a leader is periodically changes by adding a layer of automation on the work by Besseghieur et al.
8
We simulated our proposed solutions and conduct a set of experiments on a group of low-cost e-puck2 robots using the ROS framework to validate the effectiveness of our approach.
The rest of this article is organized as follows: We begin by presenting an overview of the formation control problem, including the trajectory tracking problem and its conversion to a formation control problem. Next, we introduced a Lyapunov-based motion controller from the literature designed to drive robots, and an avoidance controller to guarantee collision-free motion. Following this, we present our proposed algorithms, including the avoidance algorithm as well as an assignment algorithm to address the leader failure problem. We then report on the simulations conducted using GAZEBO robotics simulator. Experimental results using a group of four e-puck2 robots are presented to verify the effectiveness of our algorithms. Finally, we draw conclusions and offer considerations for future work.
Related work
Several control strategies have been used to solve leader-follower formation control problem. Chen et al. 11 employed a receding-horizon control scheme with a leader-follower formation control strategy to solve the formation problem of multiple nonholonomic mobile robots with a rapid error convergence rate. The authors address formation problems when robots move backwards by explicitly controlling the orientation deviation between leaders and followers. In their approach, however, the orientation of the leader is not taken care of as the leader is assumed to move in a straight line while generating the reference trajectory. As a consequence, formation may be lost when the angular velocity of the leader becomes non-zero.
The work by Hoshikawa et al. 12 uses a receding-horizon leader-follower formation control strategy to automatically determine an optimal formation among predefined formation according to the environment. Haga et al. 2 later extended this work by proposing an automatic formation control method with temporal logic constraints. The approach leads to an optimal formation switching in a cluttered or sufficiently small environment among predetermined formations in real time using receding-horizon.
A Lyapunov-based approach is used by Besseghieur et al. 8 in a leader-follower strategy to solve the formation control problem by converting it to a trajectory tracking problem. The authors tackle the problem by feeding trajectory information to the leader, and the leader has the task of defining a desired pose for each follower robot at some point relative to its pose. Each robot in the group tracks its desired trajectory using a Lyapunov-based backstepping controller.
Chen et al. 11 considered the same problem, however in this reference, the nonholonomic constraint of the robot is respected, and the generated trajectories for the follower robots are feasible. The work by Stipanovič et al. 13 also uses a Lyapunov-based approach in a leader-follower strategy to design a distributed formation control law that guarantees collision avoidance between agents with a bounded tracking error outside of the avoidance region.
According to Rout and Subudhi, 14 multiple autonomous underwater vehicles (AUVs) are controlled using a Lyapunov-based controller to achieve formation by utilizing the leader-follower formation control strategy in the presence of discrete data transmission between the leader AUV and the follower AUVs. A continuous-discrete extended Kalman filter (CD-EKF) is designed for follower agents to estimate the position and velocity of the leader when communication constraints occur.
Despite the wealth of research on control strategies for leader-follower formation control, none directly address the challenge of leader failure. These studies predominantly focus on optimizing formations and ensuring collision avoidance. However, they do not explicitly tackle the scenario where the leader becomes incapacitated. This gap underscores the need for future research to develop robust control strategies capable of seamlessly transitioning and adapting in the event of leader failure.
Problem definition
In this section, we present the kinematics of a two-wheeled robot, an overview of trajectory tracking problem by JIANGdagger and Nijmeijer 15 and how to use trajectory tracking to tackle the formation control problem as outlined by Besseghieur et al. 8 We then highlight the obstacle avoidance strategy and how Adouane, 9 Mouad et al., 10 Benzerrouk et al. 16 and Kim and Kim 17 used the limit-cycle approach to ensure robots avoid collision with static obstacles or other robots.
Robot kinematics
Consider a nonholonomic constrained mobile robot in Figure 1 whose kinematics are modeled by the nonlinear ordinary differential equation (1).

Robot schematic diagram.
Trajectory tracking
Consider a tracking control problem where a robot is required to track a reference robot with a posture
Formation control
Leader-follower formation control problem can be viewed as a natural extension of trajectory tracking problem. Besseghieur et al.
8
and Mastellone et al.
19
formulated the formation control problem as a trajectory tracking problem by defining a desired posture
Given the posture of the follower robot
Obstacle avoidance
We want robots to avoid static obstacles along their respective trajectories and avoid collision with other robots when switching roles in case of failure of leader failure. Several avoidance strategies can be found in the literature. An interesting overview of some of these strategies is given by Minguez et al. 20 Mastellone et al. 19 and Barogh et al. 1 addressed the avoidance control using an avoidance function defined by Stipanovič et al., 13 and Skowronski and Leitmann 21 which is active only in the bounded sensing regions of each individual robot and do not interfere with the robot’s individual optimal control law outside of this region.
In limit-cycle avoidance strategy, a robot needs to follow accurately the limit-cycle vector fields defined by the following set of differential equations:
The control law used by Adouane
9
to follow these trajectories is orientation control. The robot’s desired orientation is given by equation (10) below:
Control architecture
In this section, two algorithms are presented: our proposed limit-cycle obstacle avoidance algorithm that determines which obstacles are to be avoided and whether an obstacle is completely avoided or not, and an assignment algorithm that tackles the problem of robot failure by assigning an appropriate role to each robot in the team.
Obstacle avoidance algorithm
We use a reactive avoidance approach when an obstacle that can obstruct a robot’s motion is detected. While the reactive approach by Huang et al. 22 and Zhang et al. 23 activates the avoidance controller only when the robot is close to an obstacle, the approach introduced by Adouane, 9 Mouad et al., 10 Benzerrouk et al., 16 and Kim and Kim 17 activates the avoidance controller as soon existence of an obstacle that can obstruct the motion of a robot is detected, thus reducing the amount of time needed to reach the target. In contrast to previous approaches, where the disturbing obstacle is assumed to be on a path between a robot and the target position, our work is on a trajectory tracking problem where a near zero tracking error is expected. Hence, robot and goal positions are approximately the same.
Our proposed approach to obstacle avoidance is different from the avoidance algorithm by Adouane,
9
and Benzerrouk et al.
16
in order to suit our trajectory tracking problem. Inspired by Adouane,
9
we define a region of influence of radius
To avoid an obstacle it is necessary to:
Detect obstacle to avoid. Define an escape criterion which determines if an obstacle is completely avoided or not.
We define

Phase portrait of the limit-cycle defined by equation (9).

Definition of robot’s position relative to an obstacle.
We define
Remark 1
The transition time depends on the predefined value of the constant linear velocity in the avoidance controller, as well as the radius
Assignment algorithm
Leader failure is the major drawback practical of the leader-follower formation control strategy. According to Besseghieur et al.,
8
this problem is addressed by dynamically changing the leader, choosing a new leader from the follower robots through a dedicated workstation. Formation parameters are also (re)defined through this workstation. This seems like a good idea; however, it does not explicitly solve the problem because the newly selected leader could fail as well. The approach also adds the burden of having a dedicated supervisor at the workstation to manually select a new leader. In this work, we propose a new approach to solve this problem. Our approach consists of an algorithm that assigns a role to each robot in the team. We rank roles serially from

Role positions in a square-shaped formation with robots occupying positions sequentially.
The pseudocode for this algorithm is as follows:
Remark 2
The leading vacant role is the role with the highest rank from the list of vacant roles. The algorithm assumes that robots can easily know the state of their team members, that is, the role a robot member is occupying and whether it is active or not. Its implementation is possible because of the available communication resources.
Implementation
Robots need to communicate data with other robots in the group to achieve formation, avoid obstacles, or perform any given task as a group. As such, a reliable system is required for robots to interact with one another. One of such system is the robot operating system (ROS), a framework for writing robot software. ROS is a collection of tools, libraries, and conventions that aim to simplify the task of creating complex and robust robot behavior across a wide variety of robotic platforms. 24 ROS provides functionality for hardware abstraction, communication between processes over multiple machines, and great tools for visualization. It also provides the flexibility to work with heterogeneous devices in a shared environment. This makes ROS the ideal framework to implement our algorithms. We carefully select packages that meet our requirements for implementation.
Simulations
In this section, simulations are presented to verify the effectiveness of our algorithms. To run our simulations, we developed a simulation platform using GAZEBO, an open-source 3D robotics simulator on ROS Melodic, running on Ubuntu 18.04. What follows describes the simulation results for our proposed obstacle avoidance algorithm, periodic leadership switching, and assignment algorithm.
Simulation 1: Obstacle avoidance
Consider a nonholonomic constrained mobile robot on a ground plane whose initial position is chosen at random relatively close to the trajectory. The goal is to track a given reference trajectory and simultaneously avoid obstacles that might be present along. We set the control parameters for the tracking controller to be
Simulation results in Figure 5(a) show our robot leaving its referenced trajectory each time a disturbing obstacle is detected by switching to avoidance controller, and then switching back to tracking controller when escape criterion is satisfied. Figure 5(b) shows how our proposed approach responds to obstacles that are not exactly along the trajectory. It can be observed from the plot how the robot is taking a slightly longer time for tracking errors to converge to zero for disturbing obstacles off the trajectory.

Simulation results for the proposed limit-cycle-based obstacle avoidance algorithm. (a) Trajectory of the robot avoiding three different obstacles exactly on the reference trajectory. (b) Trajectory of the robot avoiding the first obstacle exactly on the reference trajectory, with the second and third obstacles near the reference trajectory close enough to obstruct the motion of the robot.
Simulation 2: Formation control with periodic leader switch
As discussed in the previous sections, leader-follower formation control strategy is easy to implement, but suffers a major drawback of leader failure, resulting in followers’ inability to complete the given task. One way to solve this problem is by periodically changing the leader, this is different from what Besseghieur et al. 8 presented in the sense that new leader selection is automatic, all robots are controlled using a single workstation, and as well, our leader robot is controlled by tracking and avoidance controllers. At each transition, the new leader breaks out of the formation to continue with the trajectory tracking, and of course, avoids collision with the former leader present along the trajectory. Other followers and the former leader then take new positions with respect to the new leader and move in a formation. To illustrate this approach, we run two simulations with four and three robots respectively tracking first a linear and second a circular trajectory.
Figure 6(a) shows the result of our simulation using four robots tracking a linear trajectory. The plot shows the robots’ trajectories while in a formation and during leadership transition. The plot of the formation shape confirms the convergence of the robots to the desired formation anytime a new leader takes charge of the team. The case is similar in the second simulation as shown in Figure 6(b) with robots moving in a triangular-shaped formation.

Simulation results for the leader-follower formation control with periodic leader switch. (a) Trajectories of four robots in a rhombus shaped formation tracking a referenced linear trajectory and the formation shape when robots 0, 1, 2, and 3 are leading the team, respectively, in the first, second, third, and fourth periods. (b) Trajectories of three robots in a triangular shaped formation tracking a circular trajectory showing leadership transition stages and the formation shape after complete leadership transition.
Simulation 3: Assignment algorithm
Consider a group of four nonholonomic constrained mobile robots on a ground plane. For each of the robots in the group, we write a distinct control script which runs on the robot. When a robot is leading the group, its control script gets trajectory information and control the robot to track it, and as well, publish formation information. Follower robots have no access to the reference trajectory, rather, they get formation information from the leader. During the simulation, each robot knows its pose and that of other robots in the group with respect to the origin (
We launch the robots sequentially to track the reference trajectory in a formation. Robot 0 being the first to be launched takes the leadership of the group while other robots take positions in the formation according to their respective roles. Figure 7(a) depicts the robots’ trajectories tracking the circle in a rhombus shape formation. In this case, none of the robots failed, and we observed the robots’ trajectories, their positions in the formation, and the formation shape for a complete cycle.

Simulation results for a group of four robots in a rhombus shaped formation subjected to robots failure. Active and failed robots are represented by circular-blue and diamond-green markers respectively. (a) Trajectories and formation shape of robots without robots failure with robot 0 leading the group. (b) Robots’ trajectories and formation shape when robots 2, 1, and 0, respectively, fail at different time instances. (c) Robots’ trajectories and formation shape when robot 1 fails and then launched back to occupy the vacant role.
We launch the robots again in the same sequence and consider a worst case scenario of failure of multiple robots within the group. We kill robots 2, 1, and 0, respectively, at different time intervals. As shown in Figure 7(b), robots 0 and 1 maintained their roles when robot 2 died, while robot 3 leaves its role “3” to occupy the vacant role “2.” Similarly, robot 3 moves to occupy role 1 when robot 1 died, and finally become the leader when we kill robot 0. This shows that unless if each of the robots in the group have died, there is always at least one robot that will take the leadership of the team to complete the task.
We killed robot 1 as shown in Figure 7(c) to demonstrate the case of robot recovery. Robots 2 and 3 adjust their roles to follow the leader (observe the formation shape with just three robots) after robot 1 had died (diamond-green marker). After a relaunch of the failed robot, we can observe that it is now back in the team occupying the least ranked role “3.”
Experiment
Being that uncertainties are marginally handled in simulations, we run experiments using low-cost robots to demonstrate our avoidance algorithm, periodic leader switch, and assignment algorithm working on real robots.
Experimental setup
In our experiments, we use four small, low-cost, differential drive, ROS-enabled robots called e-puck2. Since the robot has a short laser reading range of just about 8cm, it cannot be used for simultaneous localization and mapping (SLAM) in a large environment. Therefore we use a ZED Stereo camera to provide the pose estimate of each of the four robots. We mount a unique AR Tag on each of the robots to be detected by the camera using the

A snapshot of our workspace.
Experiment 1: Trajectory tracking with obstacle avoidance
To demonstrate obstacle avoidance, we use two e-puck2 robots 0 and 1, with robot 0 tracking a circular trajectory and robot 1 static at a random position along the trajectory. As shown in Figure 9, robot 0 was able to detect and avoid robot 1 located at approximately

Snapshot of the obstacle avoidance experiment showing: (a) robot 0 just before the region of influence of robot 1, (b) Robot 0 inside the region of influence of robot 1 and avoiding it, (c) robot 0 back to trajectory tracking after avoiding robot 1 completely.

Experimental results for our proposed obstacle avoidance algorithm showing: (a) reference trajectory and motion trajectory for robot 0 and (b) robot 0 tracking errors and controller input velocities.
Links to experiment videos.
Experiment 2: Formation control with periodic leader switch
For this experiment, we task four e-puck2 robots to track a circular trajectory of radius 0.4 m with three of the robots following the leader, and then automatically switch leader each time a circle is complete. We implement it such that robots move in a square formation of size 0.15 m, with follower robots following the leader at bearings of 180
Experiment 3: Assignment algorithm
We run this experiment to show how our algorithm works using real robots. The case presented here is the case of leader failure in a formation. Consider four e-puck2 robots each with a unique AR tag tracking a circular trajectory in a square formation. Figure 11(a) shows the group tracking a circular trajectory in the counter-clockwise direction with the encircled robot leading the team. We forced a leader failure in Figure 11(b) by killing its control node. After the leader failure, the robot on role 1 takes the vacant role 0, while robots on roles 2 and 3 now following the new leader on roles 1 and 2, respectively. We assume to have recovered the failed robot and launched it back to the group. Figure 11(c) shows the robot back in the group right behind the new leader occupying role 3.

Experimental results showing four robots in a formation with: (a) encircled robot leading the team before failure; (b) failed leader robot out of the formation with two followers forming a triangular shape with the new leader; and (c) failed robot recovered and joined the team as a follower occupying the least ranked role to complete the formation.
Similar to the results in our simulation, the algorithm enables follower robots to overcome leader failure, and the failed robot launched back to the team takes highest ranked available role not its former role as the leader. We have considered other cases of failure, that is, failure of follower robots in the team. The video for our experiments can be found in the link provided in Table 1.
Conclusions
In this article, we study the leader-follower formation control strategy to address its practical drawback of leader failure. We proposed a novel assignment algorithm that ensure follower robots overcome the practical problem of leader failure. To ensure our robots do not collide with one another during leader switch, we propose a new limit-cycle obstacle avoidance algorithm that can be applied in trajectory tracking problems. We use trajectory tracking controller and avoidance controller from the literature, to drive robots to track a reference trajectory in a defined formation shape. A set of simulations and experiments were carried out using ROS framework and low-cost e-puck2 robots. We have shown results that verify the effectiveness of our proposed algorithms. To address the limitations of our proposed avoidance algorithm, future studies will be conducted that consider avoiding not only failed robots, but also cooperatively avoiding unexpected obstacles while cruising in a formation. Another promising direction is improving our assignment algorithm to consider more parameters in selecting new leader. These parameters can include robot’s position in a formation and sensing capabilities when dealing with heterogeneous robots.
Footnotes
Declaration of conflicting interests
The author(s) declared the following potential conflicts of interest with respect to the research, authorship, and/or publication of this article: The authors declare the following financial interests/personal relationships which may be considered as potential competing interests: Horacio J Marquez reports financial support was provided by Natural Science and Engineering Research Council of Canada.
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was funded by the Natural Science and Engineering Research Council of Canada.
