## 2 Improved APF Algorithm
### Vehicle Collision Detection Model  
When planning the APF algorithm, the center point of the rear axle of the vehicle, i.e., the prime point \(O_{\mathrm{r}}=(x_{r},y_{r},\theta)\), is usually chosen to represent the current position of the vehicle. Therefore, the planned paths are paths consisting of a series of rear axle centers, and it is not possible to determine whether a vehicle is in a collision only at the rear axle center point, because vehicles have volume and width, and collision detection with obstacles usually uses the outer contour of the vehicle as a reference. Since the surface of the vehicle has bumps and also the vehicle itself is irregularly shaped, the outer contour of the vehicle is simplified to a rectangle, and a plurality of envelope circles are used to cover the surface of the rectangle in response to the presence of bumps. Given that the APF algorithm is more sensitive to the combined force, in order to improve the safety of the planned path, and at the same time, in order to approximate the expansion of each contour of the vehicle body, to ensure that the vehicle still has enough expansion circle area when avoiding obstacles. If fewer expansion circles are used, it will lead to the model area not being expanded. At the same time, if the number of expansion circles is too high, it will lead to an increase in the computational complexity, so this paper selects three rows of a total of 14 envelope circles to cover the body. In order to improve the accuracy of the vehicle collision detection, the vehicle collision detection model is shown in Figure 24.  
From Figure 17, Or is the center of the rear axle, L1, the rear axle, L2, the front axle, d1, the distance from the rear axle to the edge of the vehicle, d2, the distance from the front axle to the edge of the vehicle, W, the width of the vehicle, \(R_{\mathrm{c}}\) the radius of the collision detection, and the radius of each envelope the same as that of the center of the two envelope circles. By using the envelope circle, the vehicle collision problem can be converted into a problem of the distance between the 14 envelope circles and the surrounding obstacles, so it is only necessary to calculate the distance between the center of each envelope circle and the obstacles and compare it with the collision detection radius \(R_{\mathrm{c}}\) to determine whether a collision occurs or not. The formula for calculating the collision detection radius \(R_{\mathrm{c}}\) and the distance between the center of the envelope circle is shown in Equations (20) and (21). \[R_{\mathrm{c}}=k\times\sqrt{\frac{L^{2}}{\left(2\times n\right)^{2}}+\frac{W^{ 2}}{36}} \tag{20}\]  
\[d=2\times\sqrt{R_{\mathrm{c}}^{2}-\frac{W^{2}}{36}} \tag{21}\]  
Figure 24: Vehicle collision detection model diagram. where \(n\) is the maximum number of envelope circles in a row, which is 6 in this paper. \(L\) is the axis distance, and \(k\) is the envelope circle radius expansion factor. According to the coordinates of the center point of the rear axis \(O_{\rm r}=(x_{r},y_{r},\theta)\), to calculate the center coordinates of the 14 envelope circles, collision detection can be carried out. In this paper, we give the eight center coordinates of \(O1\), \(O2\), \(O3\), \(O4\), \(O10\), \(O12\), \(O13\), and \(O14\), and the calculation formula of the other center coordinates is similar. The calculation formula is shown in Equations (22)-(29). \[\left\{ \begin{array}{l}O2_{\rm x}=x_{r}-L1\times\cos\theta-d1\times\cos \theta\\ O2_{\rm y}=y_{r}-L1\times\sin\theta-d1\times\cos\theta\end{array} \right. \tag{22}\]  
\[\left\{ \begin{array}{l}O1_{\rm x}=O2_{\rm x}-d1\times\sin\theta\\ O1_{\rm y}=O2_{\rm y}+d1\times\cos\theta\end{array} \right. \tag{23}\]  
\[\left\{ \begin{array}{l}O3_{\rm x}=O2_{\rm x}+d1\times\sin\theta\\ O3_{\rm y}=O2_{\rm y}-d1\times\cos\theta\end{array} \right. \tag{24}\]  
\[\left\{ \begin{array}{l}O4_{\rm x}=O1_{\rm x}+d1\cos\theta\\ O4_{\rm y}=O1_{\rm y}+d1\sin\theta\end{array} \right. \tag{25}\]  
\[\left\{