Self-Organised Collision-Free Flocking Mechanism in Heterogeneous Robot Swarms

Flocking is a social animals’ common behaviour observed in nature. It has a great potential for real-world applications such as exploration in agri-robotics using low-cost robotic solutions. In this paper, an extended model of a self-organised flocking mechanism using heterogeneous swarm system is proposed. The proposed model for swarm robotic systems is a combination of a collective motion mechanism with obstacle avoidance functions, which ensures a collision-free flocking trajectory for the followers. An optimal control model for the leader is also developed to steer the swarm to a desired goal location. Compared to the conventional methods, by using the proposed model, the swarm network has less requirement for power and storage. The feasibility of the proposed self-organised flocking algorithm is validated by realistic robotic simulation software.


Introduction
Flocking, a collective motion of individuals with a limited communication ability, is a social animals' common behaviour observed in nature [1]. There are many types of collective motions in nature mainly found in living organisms and social animals, such as shoals of fish [2], flocks of birds [3] and swarms of wildebeest [4]. In addition, Kaiser et al. [5] have demonstrated that microscopic colloidal particles show collective motion in presence of magnetic fields. Inspired by the collective behaviours, swarm robotics has been emerged as a research topic that provides collective strategies for a large number of simple robots in order to achieve fascinating collective behaviours [6,7]. These collective behaviours potentially provide promising solutions to real-life problems, e.g. balancing the exploitation of renewable resources [8], autonomous swarm shepherding [9], fault detection [10], exploration in extreme environments [11,12] and coordination control of multiple autonomous vehicles [13].
To achieve the collective behaviours and to develop collective mechanisms, a large and growing body of literature has investigated modelling and designing the swarm systems. Considerable works have been undertaken from various angles such as distribution [14], communication [15], sensing [16] and coordination [17]. As a significant aspect of swarm systems, cooperation strategy particularly plays an important role in successfully achieving flocking behaviour. Hence, different strategies have been developed based on various disciplines to present collective motion as a connected swarm behaviour, for example, in the study conducted by He et al. [18], disk graph and Delaunay graph methods were used to present connectivity with various distances. In [14], mean-field game model was presented by partial differential equations to describe the swarm dynamics based on state and distributions. The performed study by Thrun et al. [19] proposed a cluster analysis that used the projection method based on the topographic map. These strategies can be divided, on the basis of its framework, into two main categories: homogeneous and heterogeneous [20]. A heterogeneous group of swarm robots contains various types of robots with different roles and responsibilities, while in a homogeneous swarm, every individual follows the same strategy to achieve the same task, hence, there are no behavioural or physical differences between the individuals in a swarm [21]. A heterogeneous model is used in this research study to achieve centralised decision making for a swarm of robots.
Bio-and nature-inspired flocking mechanisms were investigated in many studies, e.g. Reynolds flocking model [22] is one of the fundamental swarm flocking presentations. In another study [23], a leaderless mechanism was proposed, in which robots estimated swarm's centreof-mass using neighbouring robots detection within their sensing radius. Campo et al. [24] proposed a target estimation method based on a negotiation within the swarm during a flocking scenario. The study by Turgut et al. [25] set up a self-organised flocking using real mobile robots which were locally connected using wireless network. In addition, a collective motion with combination of aggregation and velocity alignment was proposed [26]. In [27], collective motion was investigated under two conditions that are i) agents follow their own polarity and ii) agents interact with each other. Moreover, a flocking mechanisms was proposed in [28] using magnitude-dependent motion control to steer a swarm. In a recent study, Na et al. [29] presented a bioinspired collective migration of a swarm that were steered by movement of an external cue embodied in an artificial pheromone. In a seminal study in collective motion, Ferrante et al. [30] proposed a flocking method based on active elastic sheet (AES), which is a self-propelled mechanism where swarm particles can successfully achieve collective motions. The aforementioned studies are examples of collective motion mechanisms which were mainly inspired by nature.
On the other hand, theoretical studies based on multiagent systems have been conducted for several decades. In [31], a consensus algorithm was developed for multi-agent systems under fixed and switching communication topologies. The synchronisation of the agents can be achieved via only local information. In [32], a robust consensus control scheme was designed for voltage and frequency restoration of islanded microgrids, where the effects of model uncertainty, parameter variation and unmodelled dynamics were considered. Time-varying delays were also considered in the leader-following consensus problems as shown in [33], where a condition to reach consensus and an estimation of the convergence rate were given. Based on the progress of the research in the area of multi-agent consensus control, various formation control techniques have been developed for swarm systems to handle more practical applications. In [34], formation tracking of networked mobile robots using bearing measurements was proposed. In another work [35], a two-layer formation-containment coordination scheme was proposed and an application to artificial satellites formation flying was shown. In [17], robust formation coordination of robot swarms was analyzed, where the nonlinear dynamics and unknown disturbances were considered in the coordination protocol design. As shown in the aforementioned literature, multi-agent systems play an important role in coordinating robots to accomplish the desired goals especially in real-world applications.
Typically, nature-inspired swarm strategies are simple but offer less precise swarm behaviour. In contrast, multiagent systems theory generally provide more accurate control for a swarm, but has a higher computational cost. A well-designed heterogeneous swarm system, such as leaderfollower mechanism, is able to combine the advantages of nature-inspired swarm systems with multi-agent systems theory. Using a leader-follower mechanism, where a leader acts as a local central controller and followers act as a swarm system dealing with the target task e.g. weeding, will provide great opportunity for swarm systems in realworld applications. This means, a leader, an expensive robot equipped with various communication and sensing tools, plays a base transceiver stations role in a swarm, while followers are low-cost individuals that receive high level commands, e.g. steering the swarm, from the leader. However, one of the common challenges in the leaderfollower mechanism is distributing tasks. Providing a model to allocate efficient tasks for leader and follows is crucial, which may largely decrease the overall mission completion time and energy costs and even further lower the requirement for hardware. Besides, how to improve the robustness of a swarm is also a challenge in swarm robotics [20]. An ideal swarm mechanism should be able to provide a solution to ensure the majority of robots achieve the goal even when a small amount of robot get lost.
In this paper, we proposed a leader-follower mechanism combining a low-cost heterogeneous swarm (for the flock) and a leader coordination control. The proposed leader-follower mechanism is tailored for the real-world applications of swarm robotics, to reduce the cost of implementation by deploying a small number of costly robots that are coordinating the entire swarm system. To combine hardware and collective control algorithms, the motion model was applied to a swarm of simulated robots by carefully considering the physical properties and hardware limitations of the real robots. Simulated experiments were performed to analyse the group performance of the swarm flocking with the leader-follower mechanism. Followed by these qualitative experiments, the group behaviours were evaluated using two metrics, i.e. the average distance between the robots and the swarm alignment in the swarm. The results were analysed to identify the effects of the chosen factors including time, population size, force and desired distance. This information will potentially help follow-up studies to address limitations of implementation using real swarm robots in real-world applications.
The rest of this paper was organised as follow. In Section 2, we introduced the swarm mechanism and leader motion. Following that, in Section 3, we explained the robotic platform and experimental setup. In Section 4, we discussed the experimental results and analysed effects of different factors in collective swarm performance. Finally, in Section 5, we drew conclusions and discussed the future research direction in which the swarm robots might be involved.

Flocking method
The proposed flocking method, including the swarm controller and leader's coordination control, is presented in this section. Apart from the leader, every robot follows the swarm mechanism.

Swarm mechanism
In the swarm mechanism, we designed a strategy to shape a swarm and build a network, so that the robots interact with each other. Meanwhile, we proposed a solution for obstacle avoidance which is a critical topic in application of swarm robotics in real-world scenarios. As a result, the swarm not only can perform the collective motion in an open space, but also is able to avoid obstacles and maintain the group after the obstacle avoidance task. First, we described the system as Eqs. 1 and 2 which show the description of each robot on position,˙ p i , and robot rotation,φ i . The movement of each robot is controlled by two different forces: i) the repulsive force, F o , and ii) the collective force, F i , described as Eqs. 3 and 4.
where coefficients α and β are related to linear speed and angular speed of the collective movement.n i andn i ⊥ are unit vectors, wheren i has the same direction as the heading of the robot, whilen i ⊥ is perpendicular to the heading direction. D r is the noise value in the process of detecting distances between robots.ξ r is a unit vector with a random direction, so that noise is applied in an arbitrary direction. φ i is the angle which the robot i is expected to rotate. A positive value of φ i determines a clockwise rotation and a negative value is a counterclockwise rotation. F o and F i are described as follows F o presents the force which obstacles exert to the robot and the repulsive force F o is related to the differences between r o and l o . r o is the vector from the centre of the robot to the obstacle o, so r o is the distance between the robot and obstacle o. l o is the threshold of avoiding action. n o is the total number of obstacles. Obviously, the repulsive force is zero when the distance between robot and obstacle equals to the threshold. The force increases as the robot move close to the obstacle.
The repulsive force is only applied when the robot near an obstacle, which is shown in Algorithm 1. The repulsive force aims to avoid obstacles for each robot on their path, while the collective force is used to build a network among robots.
Similarly, the vectorial summation of the difference between neighbouring distance and desired distance is presented as a collective force, F i , shown in Eq. 4. n n is the number of neighbours. r ij is the neighbouring robot which is a vector from the centre of the robot i to its neighbour j . Therefore, r ij is the distance between robot i and j . l ij is the desired distance between two neighbouring robots. The difference between the absolute value of r ij and l ij is the error of collective motion. k l ij is a parameter which acts like a spring constant, involving the amount of force that robots generate according to the collective distances.

Remark 1
In some relevant works, obstacle avoidance was considered in the leader-following formation control design. For example, in [36], a leader robot travelled across an area with obstacle avoidance and a follower robot followed the exact same trajectory to avoid these obstacles. Bluetooth technology was used for communication between the two robots. In another study conducted by Lee et al. [37], three boundary layers were applied to achieve a local leaderfollower method. Different layers were prioritised to keep the shape of the group of robots and avoid the collision according to the distance between robots and obstacles. Apart from the leader robot, each robot followed its front neighbour. In this case, the decision of each individual robot completely relies on one neighbour robot and the swarm acts as a chain. Gain control and corrective control were adopted to set the trajectory for obstacle avoidance in [38], where Wu et al. designed a formation tracking task using one leader robot and two follower robots in the simulation. However, in the aforementioned works, one disconnection between two robots may result in the loss of the rest of the robots in the chain. Besides, as all followers require the information from the leader, the communication costs are high when a practical swarm has a large size and some robots are far away from the leader. Different from these works, in this paper, followers make decisions only based on their local neighbours within the sensing range. Therefore, if a small amount of robots lose connections, the majority of the swarm are still able to achieve the goal.

Leader motion
In this section, the motion of leader is analysed. It is assumed that the target position of the swarm can only be detected by the leader. In order to navigate all the followers to the goal, we designed the following tracking method for the leader based on the relative position information.
Consider that many robotic systems (e.g. mobile robots) can be transformed into double integrator dynamics via input-output feedback linearisation techniques [39,40]. In this work, the dynamics of the leader robot can be described by the following equationṡ where p(t) and v(t) represent the position and velocity of the robot respectively. u(t) is the control input signal to be designed. This dynamic model can also be described by the following state-space forṁ where We assume that the target will either remain static (i.e., a fixed position in the environment) or move with constant speed, hence it can be model by the following equationṡ where r p and r v are the position and velocity of the target.
The state-space model of the target can be given as followṡ where In order to track the target precisely during the mission, a suboptimal control law is designed for the leader. Let the state tracking error (11) and the initial tracking error e(0) = e 0 . Since the pair (A, B) is stabilisable, for given weighting constants Q > 0 and R > 0, there exists a positive definite P satisfying where γ > 0 is a positive gain. Motivated by [41,42], we can then design the following feedback control protocol for the leader Substituting Eqs. 7 and 14 into the derivative of Eq. 11, the expressions for the closed-loop system dynamics can be obtained aṡ Since P satisfies Eq. 12, we have which implies that A − BR −1 B T P is Hurwitz, i.e., the closed-loop system Eq. 15 is asymptotically stable. Therefore, the corresponding cost is finite and given by Considering that Eq. 13 holds, we can easily find that J < γ is satisfied, which means the suboptimality of the target tracking algorithm can be guaranteed. Therefore, by using the control law Eq. 14, the leader robot can track the goal position within finite time and the performance of the closed-loop system can be tuned by adjusting Q, R and γ respectively. This coordination algorithm of the leader lays the foundation of steering the whole robot swarm to the desired target position.
With Algorithm 2, the swarm is able to follow the leader and tracks each goal in order. As shown in Algorithm 2, when the leader reaches a goal, the index of the current goal increases one and the leader starts to reach the next destination until it reaches the final goal.

General foundation
In this work, Webots [43] is chosen as the simulation platform. It provides a realistic simulation to design a customised environments. The software includes libraries for various robots and objects, which are provided in toolboxes. As a professional robotic platform, Webots has integrated cross-compilation systems allowing users to compile and upload the controllers to real-life robots with minimum modification, which facilitates the application for future work.
In Webots software, we used a number of TurtleBot [44] robots to investigate the proposed leader-follower mechanism. TurtleBot is an affordable, open-source mobile robot with excellent expandability. The miniature size of Turtle-Bot, 138 mm×178 mm, is ideal for research in swarm robotics. Created in 2010, TurtleBot is a popular platform and has been utilised in many swarm and multi robotic studies [45,46]. As a mobile robot, TurtleBot is actuated by two differential wheels. Its maximum forward velocity is 0.22 m/s and maximum angular velocity is 2.84 rad/s. TurtleBot is equipped with a netbook, sensors and a gyroscope. 360 laser distance sensor and IMU are suitable equipment for the robotic tasks, such as mapping and localisation. With maximum payload of 15 kg, TurtleBot is able to be adopted for various tasks in the real world scenarios.

Swarm robotics experiments
In this section, we aimed to apply the aforementioned flocking mechanism for steering a swarm of mobile robots. In initialisation step at the beginning of each experiment, the orientation of each robot was randomly defined, θ ∈ [−π, +π], and the inter-robot distances with their neighbours were set within 0.3 m. In order to test the collective behaviour with different kinds of initial forms, we run experiments with four robots in different initialised shapes. In Fig. 1, a and c are the two different initialisation forms. (b) and (c) are the form of the swarm (a) and (c) correspondingly after a while (t < 10 s). In particular examples, both of the experiments took less than 10 s to achieve steady state. Since we evaluated the group performance of the teams' steady state, the initialised form does not play an important role in our experiments.
To apply the swarm mechanism, each robot has an individual controller which is implemented by its own Fig. 1 Examples of preliminary tests for the robot group in different scenarios: a and b are the screenshots for the swarm with initialisation in a square. c and d are the screenshots for the swarm with initialisation in a parallelogram microcontroller. According to the swarm mechanism, there are two forces that mainly affect the collective motion. One is the collective force, F i , and the other is the repulsive force, F o . The collective force depends on the relative positions of the neighbours, which can be calculated by summing the errors between neighbouring vector, r ij , and desired distances, l ij . Figure 2 shows an example of the initialisation of 7 robots in a swarm. Figure 2b illustrates F i between robots. Apart from the leader, all robots are exerted forces from their neighbours. Compared with Fig. 2a, It is clear that forces have contributed to creating the desired distances between robots and the interaction network structure is more obvious.
Dot products are used to calculate the scalar projection of the forces onto a horizontal unit vectorn i and a vertical unit vectorn i ⊥ in Eqs. 1 and 2. In our work, the angles betweenn i and forces depend on the distribution of surrounding neighbours in each robot's coordinate system. The component of the total force acting in the horizontal direction was calculated by summation of the component of all forces inn i direction as presented in Eq. 4. The component of the total force in the vertical direction was calculated in the same way usingn i ⊥ .
The repulsive force is calculated in a similar way. Prior to applying the repulsive force, the coordinate transformation was adopted because F o is in the global coordinate frame, while the set of F i controller on the TurtleBot is in the robot coordinate frame. Collective forces have weight parameters k which influence the forces that are applied to the robot, Force between robots; if there is a force between two connected robots, a green force arrow is used to represent the direction of the forces. c Leader-follower tracking; after adjustment between robots, the swarm is heading to the first goal by following the leader. The blue curve shows the trajectory of the leader. d Group motion; the swarm collectively move to multiple goals. The blue curve is the trajectory of the leader for example, an increase in k leads to a bigger force to pull the swarm toward a direction and vice versa.
With these force information, the controllers start to calculate total forces and correspondingly change the robot kinematics. The transformation from force to the robot's kinematics is described by the following equations. F i and F g are related to forward velocity,v i , and angular velocity, w i , which are two variables to describe the kinematics of the robot.
where parameters m and n are tuned empirically to make sure each robot rapidly adjust its speed and heading direction, which is the fundamental of group behaviour. The transformation between the goal position and the angular velocity of wheels can be derived as: Positions and orientations of the robots are recorded at each sampling time. Figure 2c and d shows the trajectory of the leader achieving the first and second goals, respectively, during the experiments. The swarm is able to follow the leader in achieving multiple goals.

Leader test
In this work, we assume that the target position of the whole robot swarm is only assigned to the leader, so it is a partially informed heterogeneous system that only leader knows about the target. Based on the relative position information between the target and the leader, the position tracking error e(t) can be detected by the leader at each time instant, t. Then, by using proposed optimal control law Eq. 14, the leader will reach the desired location autonomously within finite time. Note that the tracking speed of the leader can be adjusted by tuning Q, R and γ in solving Eqs. 12 and 13, respectively. However, due to the physical constraints of the motors in TurtleBot, we cannot select arbitrary large tuning parameters. Besides, in order to generate a smooth trajectory for the leader, we should also set a proper maximum angular velocity in the feedback linearisation controller, which is implemented in the robot's low-level control design. Since the leader robot can be observed and tracked by at least one of the follower, when the leader is moving towards the target position, the connected followers can be steered accordingly. This guarantees the completion of the flocking tasks.

Metrics
The expected flocking performance is the group of robots collectively move along the track of the leader. To evaluate the group motion, we used two metrics which have commonly used in swarm robotics area [25,29,47,48]: d s and ξ . These two metrics were calculated and recorded at each sampling time during every experiment.
1. d s is the average distance of the swarm, which is calculated with the following equation. By comparing the average distance of different groups, coherency and density can be evaluated. Typically, steady and relatively small values mean that the swarm has expected coherency.
where N is the number of robots in the swarm and r ij is the distance between robots i and j . 2. Apart from distance, swarm alignment is also critical measurements for evaluating the alignment of a group. We calculate swarm alignment as Eq. 22 in this paper. swarm alignment, ξ , indicates the agreement of the robots' heading, which is related to the vectorial sum of each individual's rotation, shown as wheren i is a unit vector along with the heading of robot i. ξ is between 0 and 1. Bigger value shows the better agreement of the robots' heading, in contrast, smaller one demonstrates a more disswarm alignmented heading performance.
Since the robots were initialised at random positions with randomly selected orientations, the values of the metrics are different between experiments at the beginning, t = 0 s.
In the following section, the results of experiments are presented and investigated to compare the impact of different parameters in the mechanism, Eq. 4. The parameters are related to time, population size (N ∈ {4, 7, 10} robots), force (k ∈ {0.5, 1, 1.5}) and desired distance (l i j ∈ {0.25, 0.3, 0.35} m) between the robots. Each set of experiments has the same parameter setting and was repeated 10 times.

Results & discussion
To address the influence of factors including time, population size, desired distance and force, various experiments were designed with independent object factors and fixed irrelevant variables. Each set of experiments was repeated 10 times to generate the following results. Figure 3 is a randomly selected experiment where a group of robots are avoiding an obstacle. When a robot (marked with yellow circle) detected the obstacle which is on its way to the goal, the robot tried to change its heading direction because of the force from the obstacle. However, there were a few neighbours on its changing direction. Owning to the force from neighbours, it is obvious the robot was waiting from t = 2 s to t = 5 s. The robot started to chase the swarm from t = 5 s and ended up with joining the swarm at around 15 s.

Effects of time
To check the change of metrics during experiments, we implemented an experiment which corresponds to the Fig. 2c. Force parameter and desired distance were set as k = 1, l ij = 0.3 m in a swarm with N = 7 robots. Figure 4 shows the results of d s and ξ during 22 s. After initialisation, the robots adjusted to keep appropriate distances from their neighbours in the first 10 s, while the leader headed to the goal from the beginning. From t= 10 s to t = 16 s, the swarm travelled to the goal by following the leader. As shown in Fig. 2c, trajectory of the leader robot Similarly, swarm alignment ξ changed dramatically at the first 10 s, with minimum value 0.02. During the travelling period, the swarm alignment almost stayed at 1, which indicates the swarm was able to maintain the coherency within this period of time. Turning triggers the adjustment between robots, which is the reason of the slight fluctuation after t=16 s.

Effects of population
With k = 1 and l ij = 0.3, experiments were conducted using various population sizes N ∈ {4, 7, 10} robots. Results were collected during the period when all experiments reach steady state, so the length of the data set might different among Sections 4.2, 4.3 and 4.4. Figure 5 shows the obtained results in different populations.
As shown in Fig. 5a, d s rises as the population increases. The results of average distance were more consistent (less fluctuations) for the groups with N=4 and N=7 robots than size and coherency of the swarm was also reported in [12].
In terms of the swarm alignment ξ , increasing population triggers worse alignment. Similar results were also reported in [25]. The results from experiments with N=7 robots showed the tightest distribution, with approximately ξ =0.92. Experiments with N=10 robots have the worst group performance among these experiments and spread out more dramatically than the other two settings, with the median value around ξ =0.89. The obtained results from experiments with N=4 robots has the best distribution, with 0.94 and nearly 1 as the median value and maximum value respectively. Compared the distribution of desired distance in Fig. 6a, the swarm mechanism with k = 1 has the best coherency among the experiments. The average distance changed between 0.47 m to 0.58 m. It can be clearly observed that mechanism with k = 0.5 yields better coherency than the one with k = 1.5, but has a greater chance to change. It means the swarm with k = 0.5 tends to change the form compared with the other one.

Effects of force
Considering the results of Fig. 6b, all experiments have chance to reach a bigger value. The mechanism with k = 1.5 has greater variability in changing orientation, which leads to worse swarm alignment of the swarm. In contrast, k = 0.5 contributes the best swarm alignment among the experiments, with less dispersion of the data and the relatively big swarm alignment value.

Effects of desired distance
Desired distance is a parameter which involves with the expected distance between robots and their neighbours. Robots adjust their positions based on the difference between the estimated neighbouring distance and the expected distance. The impacts of different l ij are illustrated in Fig. 7.
Shown in Fig. 7a, an increase in l ij increases the average distance as expected. In case of l ij = 0.25, it increases the risk of dispersive distribution of average distance, though it has a greater chance to reach the minimum value. The average distance of swarm with l ij = 0.3 maintains around 0.41 m, which is enough for followers to track the leader. With 0.455 m, the coherency of the swarm using l ij = 0.35 is the worst among the experiments, namely the larger desired distance might hinder the collective dynamics.
According to Fig. 7b, the swarm alignment has the chance to reach the maximum value with various settings of desired distances. A clear indication of the case with l ij = 0.25 shows the observed results from the swarm performance spread out dramatically. In case of l ij = 0.35, the swarm provided the best swarm alignment, although the results had greater distribution in comparison with other two settings.
The aforementioned analysis demonstrated the impact of population, force and desired distance on the group performance and also provided a guidance to tune the relevant parameters based on the desired swarm behaviour. According to the results and discussions given in this section, it can be concluded that the collision-free flocking task can be achieved by the proposed mechanism and the performance can also be potentially adjusted to fulfill the requirements of real-world applications. In terms of improving the swarm performance, methods such as neural collaborative filtering and fuzzy clustering algorithm [49] could be exploited to achieve group flocking behaviour of heterogeneous robot swarms.

Discussion
Previous work by Ferrante et al. [30] has established that the swarm collectively move to a goal direction in open spaces without considering the obstacles. On the contrary, the mechanism we proposed here can deal with such obstacles in the environment. The swarm is able to travel along the expected track and avoid obstacles. Even robots spread out when avoiding collision, the swarm can rebuild the network and continue to drive to the goal. Compared with a homogeneous mechanism, the experimental work presented here provided a solution which has less requirement for robot's hardware especially in terms of communication and storage. In previous work [50], apart from obtaining data from neighbouring robots, each robot in the swarm must know the location of the goal. On the contrary, in this study, only the leader robot is assumed to know the goal information and all follower robots just need to use the local information from the neighbours. In this case, the proposed solution can decrease the communication costs of individual robots and further make the swarm more affordable.
It is now well established from a seminal work by Ş ahin [51], each robot in a swarm system makes decisions only based on its neighbours' states and only interacts with its direct neighbours within a specific range, sensing radius, due to the limitations of real robots' hardware in practical scenarios. Therefore, direct communication in a swarm system without having an extra observer, central controller, is one of the challenges of implementing swarm scenarios using real mobile robots [20].
Some research studies [13,29,52,53] relied on the acquisition of the location of each robot from an external observer, whereas some [30,54] regarded each robot as an abstract particle without considering physical properties e.g. weight, size, motors speed and sensing range. Such approaches, however, can not realistically address the situation in which the group operation is influenced by the physical and hardware design constraints. In this work, the swarm is not controlled by a central controller. Every follower makes decisions based on its neighbours and surrounding obstacles, while the leader only requires the information of the goal and surrounding obstacles. Compared to those aforementioned works, the mechanism we proposed here is more realistic for the application in real robots.
In terms of the limitation of this work, we did not considered optimisation of the parameters in Eqs. 1-4. Hence, using optimisation algorithms, e.g. [55,56], will benefit the choice of these parameters.

Conclusion
The main goal of this study was to design a generalised swarm mechanism which has the ability to adapt to a complex environment. Using a leader and a number of followers, the swarm network successfully finished the designed tasks, which has gone some way towards enhancing our understanding of the swarm application in the real world, such as, collective mapping and collective sensing. Compared with the previous work, one of the most obvious improvement to emerge from this study is that the swarm network has less requirement for power and storage. The analysis of factors undertaken here can be considered the first step from an abstract mechanism to the progression with real robots. In the future, a greater focus on application in real robots could produce findings that account more for precision agriculture, collective sensing and so on.