Flocking Control of Mobile Robots with Obstacle Avoidance Based on Simulated Annealing Algorithm

Flocking control problem of mobile robots under environment with unknown obstacles is addressed in this paper. Based on the simulated annealing algorithm, a flocking behaviour for mobile robots is achieved which converges to alignment while avoiding obstacles. Potential functions are designed to evaluate the positional relationship between robots and obstacles. Unlike the existing analytical method, simulated annealing algorithm is utilized to search the quasi-optimal position of robots in order to reduce the potential functions. Motion control law is designed to drive the robot move to the desired position at each sampling period. Experiments are implemented, and the results illustrate the effectiveness of the proposed flocking control method.


Introduction
Flocking problems are studied and applied in many research fields, such as self-organized mobile sensor networks in [1], cooperative unmanned aerial vehicles (UAVs) in [2][3][4][5], and military reconnaissance in [6]. Research of flocking behaviour stems from the coordination phenomena in nature, from swarming of bacteria, biochemical cellular networks, up to flocking of birds, schooling of fish, and herds of land animals [7]. Reynolds proposed a computer model of coordinated animal motion named "boids" in [8] and defined three concepts to describe the behaviours of boids: (1) Collision avoidance: avoid collisions with nearby flockmates (2) Velocity matching: attempt to match velocity with nearby flockmates (3) Flock centering: attempt to stay close to nearby flockmates ese behaviours are seen in astonishing amount of coordinated systems, which exhibit unbelievable efficient and robust coordination [9,10]. ese inspired a lot of work in statistical physics and control theories about stability. Flocking behaviour has been addressed in the context of nonequilibrium phenomena in many degreeof-freedom dynamical systems and self-organization in systems of self-propelled particles [7,11,12].
Booming-related work has been done worldwide in the last decades. Some works focus on the dynamic model of mobile robots [13]. In [14], a method based on the intrinsic properties of the Euclidean plane is proposed for the calculation of the moving mechanism on a trajectory. In [15], a direct analytical method for solving the linear transformation of the characteristic equation for industrial robots is proposed. A model predictive flocking control scheme for second-order multiagent systems with input constraints is designed in [16]. In [17], a dynamic pinning control algorithm (DPCA) is developed to generate stable flocking motion for all the agents without the assumption of connectivity or initial connectivity of the network. In [18], a distributed control protocol with individual local information is proposed for the secondorder multiagent system with interference. e problem of flocking and velocity alignment in a group of kinematic nonholonomic agents in 2 and 3 dimensions is addressed in [19]. A geodesic control law that minimizes a misalignment potential and results in velocity alignment and flocking is proposed. In [20], the flocking of multiple agents which have significant inertias and evolve on a balanced information graph is studied. Passive decomposition method is used to incorporate this inertial effect which can cause unstable group behaviour. e proposed flocking control law is proven to be stable and can ensure that the internal group shape is exponentially stabilized to a desired state.
In recent years, the flocking problem of mobile robots has become an attractive subject in the research field of the multiagent system and cooperative robots. In [21], the cooperative motion coordination of leader-follower formations of nonholonomic mobile robots under visibility and communication constraints in known polygonal obstacle environments is studied. Each robot can take care of converging to a desired configuration while maintaining visibility with its target. Flocking with obstacle avoidance is an emerging research interest in recent years [22][23][24][25][26]. A new distributed coordination algorithm with Voronoi partitions for multivehicle systems is presented in [22], which results not only in obstacle avoidance and motion to the goal but also in a desirable geographical distribution of the vehicles. A flocking algorithm in the presence of arbitrary shape obstacle avoidance is presented in [23] both in the 2D space and 3D space. In [27], learning-based model predictive control approach is applied to the flocking problem of UAVs in the presence of uncertainties and obstacles. A distributed framework that ensures reliably collision-free behaviours in large-scale multirobot systems with switching interaction topologies is presented in [28].
In practical applications, such as formulation of the mobile robot or surface vessels, the agent model is underactuated, and the kinematic motion is constricted with nonholonomic constraints. In our research project, Ami-goBot is adopted as an α − agent in the flocking control problem. e kinematic model of AmigoBot is a kind of nonholonomic system in which the number of control inputs is less than the degree of freedom and cannot be transformed into a second-order linear system. It is necessary to redesign the control algorithms for the flocking of AmigoBots.
In this paper, a control method for the flocking problem of mobile robots is proposed. Simulated annealing (SA) algorithm is used to design a simple behaviour for each robot while flocking can be self-established. SA algorithm is a probabilistic technique for approximating the global optimum of a given function. Specifically, it is a metaheuristic to approximate global optimization in a large search space for an optimization problem. It is often used when the search space is discrete (e.g., the traveling salesman problem). For problems where finding an approximate global optimum is more important than finding a precise local optimum in a fixed amount of time, simulated annealing may be preferable to alternatives such as gradient descent. e paper is organized as follows. Section 2 gives the kinematic model of AmigoBot and the problem formulation. Design process of the flocking control law is presented in Section 3. Simulation is implemented to illustrate the effectiveness of the proposed control law, and results are shown in Section 4. Finally, the conclusions are made in Section 5.

Model of Flocking Agents.
e first model which is widely considered as a flocking agent is constructed in [12], which was proposed by Vicsek et al. to interpret the flocking phenomenon such as clustering and convection: where x i is the position of particle i on the plane, v i is the velocity with an absolute value v and an angle given by θ(t + 1), i � 1, 2, · · · , n, 〈θ(t)〉 r is the average direction of the particles in the neighbourhood of particle i, and Δθ is the random noise. From the perspective of theoretical research, the dynamics of agents in flocking is also often modelled as a second-order linear system [29]: where x i , v i , and u i are the position, velocity, and control force, respectively. e other second-order linear system of the flocking agent is proposed in [30,31]. e agents moving on the plane are modelled with the following dynamics: where

Kinematic Model of the Mobile Robot.
Different from the agent models proposed above which are treated with the linear system, the kinematic model of the mobile robot is much more complex. As shown in Figure 1, the mobile robot is controlled only by the velocities of two drive wheels.
Assuming that there exists no slipping motion between the wheels and the ground, the dynamics of AmigoBot can be modelled as where v i and ω i are the linear and angular velocity, respectively, (x i , y i ) is the position of AmigoBot in Cartesian coordinates, and θ i is the orientation angle of the AmigoBot.
Unlike the models of (1)- (3), mobile robot like AmigoBot is usually considered as a nonholonomic system due to the fact that the system has less dimension of control inputs than its degrees of freedom. For AmigoBot, it has 3 degrees of freedom, i.e., the lateral and longitudinal motion on the horizontal plane and rotatory motion along the axis vertical to the horizontal plane but with only two control inputs.
For the differential wheel drive mobile robot, it has Ri and v Li are the velocities of the right and left wheel, respectively, and L is the distance between the two wheels as described in Figure 1. Constrained by limitations on the control inputs, the existing flocking laws or algorithms are not suited for the flocking control problem of mobile robots.

Potential Function of Coordination.
Each mobile robot is considered as an α − agent. Define the position vector of the i th AmigoBot with r i � [x i , y i ] T . e relative positions between the i th and j th AmigoBots are defined with r ij � r i − r j . e distance between these two AmigoBots is then given with ‖r ij ‖. A potential function V ij is defined to evaluate the relative positions between any pair of neighbouring AmigoBots as follows: where d r > 0 is a design parameter. e curve of function V ij is shown in Figure 2. d r determines the desired distance between the agents. When ‖r ij ‖ � d r , it has min V ij (‖r ij ‖) � 2 + log(d 2 r ). Unlike the potential function proposed in [31], also shown in Figure 2 as traditional V ij , the third term in (5) is helpful to get a flexible behaviour such as split and squeezing maneuver in an environment with obstacles. e potential function of AmigoBot i is then defined with the sum of all V ij : where A is the set that includes all other AmigoBots that the i th AmigoBot can detect with sensors.  [32]. Define the projection of the position r i of robot i on O k as

Potential
where Ω k is the boundary of O k . Define the distance between robot i and its projection q ik on the obstacle O k with ‖r ik ‖ � ‖r i − q ik ‖. A potential function V ik is designed to evaluate the relative position between robot i and obstacle O k as follows: Mathematical Problems in Engineering 3 where O i is the set of obstacles detected by robot i.

Flocking Behaviour via Random Search Algorithm.
With the aforementioned designed potential functions V i α and V i β , the flocking control problem of the mobile robot is considered as an optimization problem in this paper. In [33], Cheng et al. designed a flocking control law that can drive the agents to evolve into the flock centering state. Motion control laws are proposed to synchronize the velocities and orientation angles via the Newton method in an environment without obstacles.
For the flocking problem of the mobile robot in a complex environment with unknown obstacles, define the total potential function for robot i as Obviously, if all the robots move towards the direction of the gradient descent of V i at each sample period, the robots will keep a desired distance among each other finally: where Θ i is the orientation space of robot i, t k is the sample period, θ * i is the optimal orientation angle which has the maximal extent of the gradient descent of V i at t k . Due to that the space Θ i is continuous, methods based on the gradient descent are generally adopted [30,33]. Methods based on the random search algorithm provide another dependable solution. In this paper, SA algorithm is applied to searching of the minimal solution of V i which is designed to regulate the flocking state.
Compared to other approximation methods, such as the Newton method, gradient descent method, and Levenberg-Marquardt method, SA can avoid being trapped in the local minimal in early iterations and is able to explore globally for better solutions in finite iterations [34]. SA is a method for solving unconstrained and bound-constrained optimization problems. e method models the physical process of heating a material and then slowly lowering the temperature to decrease defects, thus minimizing the system energy [35,36]. ere is an essential similarity between the flocking control problem and the simulated annealing course. Both of them aim to explore the optimal solution that has minimal energy or desired homogeneity. e flocking control problem of mobile robots is considered as an approximation of the optimal solution of each V i . With full information of all the other robots and the obstacles detected by sonar sensors, each robot tries to keep a quasi-optimal distance from each other in the motion while avoiding the obstacles. Firstly, the optimal position r * i with minimal V i is approximated via the SA algorithm. en, the optimal orientation angle θ * i is calculated with r * i . Finally, a motion control law is designed to drive the robot move to the optimal position r * i at each sampling period t k . e pseudo-code of the random search method of r * i via the SA algorithm is shown in Algorithm 1, where e initial position r i in Neighbor(r i ) is not generated randomly but given with r i . Also, the function Neighbor(r i ) is defined with where Step is a parameter decided by the maximal velocity of the robot and Rand is a random function which can generate a value randomly in the range between 0 and 1.
Input: objective function V i and r i , i � 1, 2, . . . , n Output: quasi − optimal solution ⟶ r * i (1) for robot i do (2) Initialize SA (T, T min , α and N) if ΔE < 0 then (9) r i ⟵ r new (10) r best ⟵ r i else (11) if exp(−ΔE/T) > Rand then (12) r i ⟵ r new (13) T ⟵ αT (14) r * i ⟵ r best (15) return r * i ALGORITHM 1: Flocking behaviour search. 4 Mathematical Problems in Engineering Obviously, if r * i is well tracked, V i would converge to the minimal value, and the distance between the agents would also converge to a constant value, which in fact is determined by d r . at is, the flocking centering state can be guaranteed.
Once the quasi-optimal position r * i is achieved, the optimal orientation angle can be calculated with Define θ e � θ i − θ * i , and design the control law for ω i with where k w > 0 is a design parameter. With the control input ω i in (15), it has Define a candidate function V θ e � (1/2)θ 2 e ; then, it has _ V θ e � −k w θ 2 e ≤ 0. With Lyapunov stability and LaSalle's invariant principle, it can be proven that the equilibrium θ e � 0 is asymptotically stable. at is, with the control law for ω i in (15), the i th AmigoBot can be steered towards the desired position r * i .

Mathematical Problems in Engineering
where v r is the linear speed of the c − agent or the speed required for the flocking motion and k v > 0 is a design parameter. e parameters in the method proposed above are designed as given in Table 1. e initial and some intermediate processes of robots are shown in Figure 3. Obstacles are plotted with squares, hexagons, and triangles. With sonar sensors, the robot can detect the obstacles at each sampling period (500 ms). e positions of the other α-agents are shared at a period of 1 sec. From Figures 3(c)-3(f ), it can be seen that the robots smartly avoid the obstacles. As shown in Figures 3(g)-3(i), all the robots attempt to assemble with a desired distance after passing through the obstacles, which brings out a flocking center state. e detailed traces of the five AmigoBots during the flocking process are depicted in Figure 4. It proves that the designed potential function of V i α and V i β can regulate the relative position between robots and obstacles effectively. e robots keep a safe distance from obstacles while across the gap and a desired distance from each other in the obstacle-free space. Connection graph of the robots marked with the red circle is shown in Figure 5, which illustrates the evolution of the flocking center state during the whole process. It can be seen that the five AmigoBots are driven to a stable pattern of geometry. Each AmigoBot has a stable neighbouring relationship and keeps a stabilized motion.

Simulation Results
For the 10 connection graphs in Figure 5, define V αk as the average of the 5 potential function V i α for each graph. It has V αk � [1605.2, 57.4, 88.9, 6.2, 148.0, 5.0, 3.9, 3.9, 3.6, 6.2]. e potential function V i α reduces greatly from the beginning and increases highly while the robots go across the obstacles and then reduces to a low value when robots are in the obstacle-free space.  x (mm)

Conclusion
In this paper, the flocking behaviour of the mobile robot in an unknown environment with obstacles is designed via the heuristic search algorithm. With the potential functions defined for the α − agent and β − agent, the mobile robot can acquire the quasi-optimal direction with the SA algorithm in finite search times. Control laws for v i and ω i are also designed. e system of mobile robots acts out separation  Mathematical Problems in Engineering and alignment behaviours obviously. Moreover, the robots can avoid obstacles, detected with sonar sensors, by a safe distance. Future work will address the issue of flocking control of mobile robots in the field environment with this proposed method.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.