## 3 Four-Dimensional Dynamic Cooperative Path Planning Algorithm
### Dynamic Priority RRT* Algorithm
Figure 14 shows the dynamic planning path of the proposed algorithm when affected by the sudden threat group for the second time, including local collision avoidance planning and 4D cooperative path replanning. Figures 15 and 16 show the satisfaction of 4D cooperative constraints of the planned path. Figure 11: Local collision-checking planning and 4D coordinated path replanning when affected by the sudden moving threat for the first time. (**a**) is the 3D view and (**b**) is the 2D view. Figure 12: (**a**) The shortest distance between UAV1 and UAV2 during local collision-checking planning. (**b**) The shortest distance between all UAVs in 4D coordinated path replanning. Figure 10: Time tolerance for all UAVs to reach the goal. Figure 14: Local collision-checking planning and 4D coordinated path replanning when affected by sudden threats for the second time. (**a**) is the 3D view and (**b**) is the 2D view. Figure 13: Time tolerance for all UAVs to reach the goal in the first replanning. Figure 15: The shortest distance between all UAVs in 4D coordinated path replanning. It can be seen in Figure 9 that the shortest distance between each pair of UAVs at the same time is larger than the minimum safety distance (2 m) we set, so it can be shown that the pre-planned path meets the space constraints in 4D cooperative constraints. At the same time, it can be seen in Figure 10 that the ETA tolerance of the five UAVs executing the pre-planned path is within 0.2 s, i.e., they meet the time cooperative constraints. When t = 4.7 s, a sudden moving threat appears in the planning space for the first time. Compared with Scenario 1, the sudden moving threat in Scenario 2 will affect two UAVs at the same time, which is more complex. The collision avoidance planning of two UAVs based on the HAPF algorithm will be executed online at the same time, and the planning needs to avoid sudden threats while preventing conflicts with other UAVs. Figure 11 shows the path of local collision-checking planning and 4D cooperative replanning. It can be seen in Figures 11 and 12 that UAV1 and UAV2 can avoid threats in the environment during local collision-checking planning, and two UAVs can maintain a safe distance to avoid conflicts. After completing local collision-checking planning, all UAVs need to conduct cooperative path replanning to meet 4D coordination constraints. It can be seen in Figure 12 that the cooperative replanning path can meet the spatial constraints. In addition, Figure 13 proves that the collaborative replanning path can meet the time coordination constraints. Similarly, when t = 16.5 s, the planning space changes for the second time. We set up a group of sudden threats to simulate the planning of escaping from the local minimum trap in local collision avoidance. It can be seen in Figure 14 that after being affected by threats, UAV3 can plan the path to escape from the local minimum. After that, all UAVs continue to replan the 4D cooperative path, so that all UAVs can reach the goal without conflict. It can be seen in Figures 15 and 16 that the second cooperative path replanning can plan the path satisfying 4D cooperative constraints for all UAVs. Based on the above analysis, we can prove that the proposed algorithm can still complete the dynamic, 4D cooperative path planning in complex scenarios. Therefore, we prove the effectiveness of the proposed algorithm in different scenarios. ### Comparison and Algorithm Performance Analysis

In this section, we compare the 4D cooperative path planning layer (DPRRT* algorithm) and local collision avoidance planning layer (HAPF algorithm) of the 4D dynamic cooperative path planning algorithm with some related algorithms. On the basis of comparison, the performance of the 4D dynamic cooperative path planning algorithm is analyzed. #### 4.4.1 Comparative Simulation and Performance Analysis of Cooperative Path Planning Layer

The DPRRT* algorithm is a decoupled cooperative planning algorithm.