## 2 Improved APF Algorithm
### Resolving Localized Oscillations Caused by U-Shaped Obstacles
It can be observed that the paths planned by the APF using the improved repulsion function have less variation, fit the global path better, incorporate the distances between the target and the obstacles well, and pass the distance factor as well as the Gaussian decay term so as to realize a nonlinear and adaptive potential field, and the minimum value of the combined potential energy point is 0.0006, which is almost converging to 0, which will provide a basis for the subsequent localized paths for the APF. The APF with the above modified repulsion function is fused with the optimized [PERSON]'s algorithm, and the simulation is shown in Figure 10 when facing a U-shaped obstacle. As can be seen from the figure, when facing the appearing U-shaped obstacles, the fusion algorithm of APF can provide the path inflection point as a temporary target point with the help of [PERSON]'s algorithm, which avoids the local oscillation phenomenon caused by the force balance due to the U-shaped obstacles. However, this type of approach is not applicable to all cases. If the U-shaped obstacle suddenly appears after the global algorithm has finished planning, and it happens to appear in the path of [PERSON]'s planning, it will still cause the phenomenon of local oscillation. Therefore, the algorithm can not always rely on [PERSON]'s path inflection points but directly in the vicinity of the U-shaped obstacles directly form a gravitational point to guide the APF algorithm to \"escape.\" Based on the above situation, this paper continues to improve. Since U-shaped obstacles usually have complex shapes and may lead to unstable potential fields, in this paper, U-shaped obstacles are ellipticized because ellipses have better mathematical descriptions for obstacles with different sizes and shapes (e.g., U- or L-shaped obstacles), which can be adapted to different obstacles by ellipticization and can be more easily dealt with when dealing with the ensemble potential field by constructing the ellipticization formula shown in Equation (11). \[\frac{\left[x-\frac{\left(u_{\max_{x}}+u_{\min_{x}}\right)^{2}}{2}\right]^{2} }{\left\{\frac{\left(u_{\max_{x}}+u_{\min_{x}}\right)}{2}+\left[\left(u_{\max _{x}}-u_{\min_{x}}\right)+\frac{width}{2}\right]\cos\theta\right\}^{2}}+\frac{ \left[y-\frac{\left(u_{\max_{y}}+u_{\min_{y}}\right)}{2}\right]^{2}}{\left\{ \frac{\left(u_{\max_{y}}+u_{\min_{y}}\right)}{2}+\left[\left(u_{\max_{y}}-u_{ \min_{y}}\right)+\frac{3 width}{2}\right]\cos\theta\right\}^{2}}=1 \tag{11}\]  
where \(u_{\max_{x}}\), \(u_{\min_{x}}\), \(u_{\max_{y}}\), and \(u_{\min_{y}}\) are the U-shaped obstacle boundary coordinates. \(\theta\) is the angle in polar coordinates, and \(width\) is the vehicle width, respectively. The approach begins by determining the center of the U-shaped obstacle, \((\frac{\left(u_{\max_{x}}+u_{\min_{y}}\right)}{2}\), \(\frac{\left(u_{\max_{y}}+u_{\min_{y}}\right)}{2})\), as the center of the ellipse and then determines the long and short axes of the ellipse based on the length of the boundary of the U-shaped obstacle plus the width of the vehicle. The long and short axes of the ellipse are determined by adding the width of  
Figure 10: Localized zoomed-in view of U-shaped obstacle avoidance. the vehicle to the length of the boundary of the U-shaped obstacle, which is the \"dilated\" half-axis of the x- and y-directions, respectively, and taking the width of the vehicle (\(\frac{width}{2}\)) into account. The \(\cos\theta\) is used for reorientation when the obstacle is not directly in the Cartesian coordinate system. Secondly, the two endpoints of the long axis are selected as the temporary virtual target points. At this time, the size of the combined potential energy of the two virtual target points is calculated, and the temporary virtual target point with the smallest combined potential energy is selected as the final virtual target point.