## 4 Cluster Path Planning Method That Resembles a Starling Flock
### Cluster Path Planning Method That Resembles a Starling Flock
The priority is adjusted to correct cluster positions in one iteration time increment according to path prediction planning, with the remaining time used for locally optimal path execution. When the number of predicted steps exceeds a certain threshold, it is likely to predict planning to the appropriate cluster position, especially after several iterations. We added a three-dimensional RRT to the clustering algorithm's free exploration flight behavior. Figure 14: Cluster flight algorithm flow chart. Compared to the algorithm flow in Section 2 Figure 5, this algorithm incorporates the RRT method into the free exploration flight behavior and adds a path planning method while maintaining the overall structure of the starling bionic algorithm. This improves the algorithm's ability to handle complex environments. Additionally, subsequent path prediction is added in each iteration to improve the cluster's flight efficiency and reduce interference and loss among individuals. The UAVs are initially distributed in space [0 100, 0 100, 50 150] at a safe distance, with initial velocities randomly selected between [40, 100] and heading angles set to 0. Figure 15 displays the algorithm's test results in MATLAB, Each line represents the trajectory of a drone. The main parameters of the simulation experiment included a perception range of 260 m, a starling nearest neighbor holding distance interval of [35, 70], an individual safety distance holding interval of [30, 60], a cluster holding distance extension of 50 m after triggering the danger space signal, and a desired cluster flight speed of 50 m/s. We conducted experiments in MATLAB using different terrains to test the method's application in various terrain situations. As shown in Figure 16, a small obstacle was added to the cluster path in terrain 2, and the clusters can be seen travelling around it from different directions and regrouping. In Figure 17, the obstacle's size was increased in terrain 3 and the cluster travelled around it from the right side. The two different obstacle avoidance methods arise from whether the UAV cluster's internal structure is disrupted. When the UAV cluster is dispersed to a certain distance, the algorithm regroups the cluster to achieve obstacle avoidance as a whole. Figure 15: (**a**) UAV bionic cluster algorithm effect diagram. (**b**) Top view of the path. Figure 16: Results on terrain two. Figure 17: Results on terrain three. Figure 18: Simulation outcomes after increasing the cluster of planes to 12. This section will extract the data from the algorithm process for the experimental findings in Figure 15 and explain them in greater detail in order to further examine the state changes of the complete cluster during the cluster flight. Figure 21 depicts the drone's course change first. The positive direction of pitch angle is deflected downward on the positive \(x\)-axis and the positive direction of yaw angle is deflected on the positive \(x\)-axis toward the positive  
Figure 19: Simulation outcomes after increasing the cluster of planes to 16. Figure 20: Simulation outcomes after increasing the cluster of planes to 20. Figure 19: Simulation outcomes after increasing the cluster of planes to 16. \(y\)-axis, both expressed in magnitude. Figure 21 samples the cluster flight process at a frequency of 1 Hz. The yaw angle changes in the range of \([-1,3]\) and finally converges to the range of \([0,0.2]\), and the pitch angle changes in the range of \([-0.5,0.3]\) and finally converges to the interval of \([-0.1,0]\). This clearly shows that the UAV cluster has achieved essentially the same heading after crossing the complex terrain. The fluctuation of the heading's second half results from the UAV's dominant position in the clustering algorithm's free flight exploration behavior. Similar to this, the speed range when flying over difficult terrain is [15; 95], and finally all fall on the speed line of 50 m/s. The cluster operates at a constant speed.