## 3 Four-Dimensional Dynamic Cooperative Path Planning Algorithm
### Dynamic Priority RRT* Algorithm
Of these parameters:

\[D=\frac{\rho(\mathbf{G}_{i},\mathbf{G}_{0})-\min\,\rho(\mathbf{G}_{i},\mathbf{ G}_{0})}{\max\rho(\mathbf{G}_{i},\mathbf{G}_{0})-\min\,\rho(\mathbf{G}_{i}, \mathbf{G}_{0})} \tag{18}\]

\[A=\frac{\Delta\omega-\min\,\Delta\omega}{\max\Delta\omega-\min\,\Delta\omega} \tag{19}\]

Then, the optimal sub-target node \(\mathbf{G}_{i}\) can be selected through the heuristic function:

\[\mathbf{G}_{i}=\text{argmin}\,f \tag{20}\]

After the UAV reaches the sub-target, the attractive potential field is constructed at the goal, so that the UAV will fly toward the goal. #### 3.3.3 Memorial Potential Field Force Strategy

When using the potential field method to plan local collision avoidance near threats, UAVs will dominate the attraction of the current path node, and the planned path direction will tend toward the target node. However, at the next path node, due to the proximity to the threat, the repulsive force may dominate, and the planned path will tend to deviate from the direction of the target node. The cycle of the two situations may cause the planned path to oscillate. UAV flight constraint optimization or some path smoothing methods are usually used to improve the local path oscillation problem existing in APF. Flight constraint optimization is to improve the oscillation problem by restricting the maximum turning angle of the UAV. However, when the vibration amplitude between adjacent nodes is large, the UAV will repeatedly turn back and forth at the maximum turning angle during flight and the vibration will still exist, which can also cause certain potential safety hazards. Therefore, the constraining of the flight angle is only applicable to some situations with small vibration amplitudes. In addition, the approach of trajectory optimization can be used to improve the vibration. Usually, the approach of trajectory optimization needs to obtain the vibration path and then perform a secondary calculation to smooth the trajectory, which does not meet the real-time requirements of online local obstacle avoidance planning in this paper. Furthermore, inspired by sliding mode control in the early work, we try to use the sigmoid function to smooth the oscillation path. This approach can obviously improve the vibration, but there is a certain lag. Therefore, we adopted the memory resultant strategy proposed in this paper to improve local oscillation. This approach has the following two advantages. * Simple calculation, high efficiency, and good real-time. The memory resultant force strategy only needs to record the resultant force of the previous step and fit it with the resultant force of the current step, without additional complex optimization or calculation processes, so it can ensure the real-time performance of the local obstacle avoidance planning level. * Capable of adaptive adjustment. The memory resultant force is calculated by the adjacent two-step resultant force. When the resultant force deviation of the two steps is large, i.e., when the potential planned path has a large oscillation, the direction of the memory resultant force can obtain a large deflection compared with the current step resultant force, so it can effectively improve the oscillation. When the resultant force deviation of the two steps is small; that is, when the potential planned path has a small oscillation, the resultant force deviation of the memory resultant force and the current step are also relatively small, so as to smooth the collision avoidance path. Therefore, this paper proposes a memory resultant strategy to dynamically improve local path oscillations. This strategy can still suppress the vibration when the resultant force direction of adjacent path nodes changes significantly. After UAV\({}_{i}\) calculates the resultant force direction to the next path node \(\textbf{X}_{j+1}\), it still retains the resultant force direction to the path node \(\textbf{X}_{j}\). The resultant force on the two path nodes is fused to reduce the variation of the resultant force angle and improve local vibration.