## 4 Positioning Fault Detection Methods
The weight parameter can allow the strategy process to switch the primary position system when a system is damaged. \[P_{f}=\frac{Prtk*Wrtk+Pslam*Wslam}{Wrtk+Wslam} \tag{1}\]  
We designed a prediction method to find reference information for autonomous vehicle applications. Reference information must be stable and reliable. This method integrates some information from the chassis and other sensors, such as the positioning system, the ABS sensor, and the IMU. We took into account that the RTK is subject to weather. From the perspective of system stability, the ABS and IMU on the vehicle are more stable than the GPS-based positioning system. Referring to these two pieces of information in the fault detection mechanism is more reliable. The positioning system provides previous valid position data. The ABS sensor provides the final speed information. The IMU provides the heading information to the algorithm. The latitude and longitude prediction algorithm equation is represented by Equation (2). The parameter \(PD_{x+1}\) is the estimated latitude data, and \(P_{x}\) is the current latitude data. The parameter \(PD_{y+1}\) is the estimated longitude data, and \(P_{y}\) is the current longitude data. The parameter \(V\) is the vehicle speed. The parameter \(\theta\) is the heading of the vehicle. Equation (3) defines \(PD_{x+1}\) and \(PD_{y+1}\) as belonging to \(P_{f+1}\). The distance calculation algorithm is shown in Equation (4) The parameter \(D_{f}\) is the distance between the prediction position and the current position. \[ \begin{cases}PD_{x+1}=P_{x}+\int_{0}^{t}V*\cos\theta dt\\ PD_{y+1}=P_{y}+\int_{0}^{t}V*\sin\theta dt\end{cases}  \tag{2}\]  
\[PD_{f+1}\ \in\ \big{\{}\ PD_{x+1},PD_{y+1}\big{\}} \tag{3}\]  
\[D_{f}\ \Big{(}P_{f},PD_{f+1}\Big{)}=\text{R}*\cos^{-1}[\cos P_{y}*\cos\ PD_{y+1}* \cos\ (\ P_{x}-PD_{x+1})+\sin P_{y}*\sin\ PD_{y+1}\ ] \tag{4}\]  
The fault result is shown in Equation (5), which is another indicator function. The parameter \(D_{r}\) is the fault detection result. \(D_{\varepsilon}\) can be a level that triggers the fault condition. If \(D_{\varepsilon}\) is less than \(D_{f}\), the result is 1. The fault detection algorithm generates an error message to the self-driving application stating that an error has occurred in the positioning system. Equation (5) fits different applications that can be rewritten. If the fault detection mechanism is used in SLAM, the parameter \(D_{r}\) can be rewritten as \(D_{r(SLAM)}\). If the fault detection mechanism is used in RTK, the parameter \(D_{r}\) can be rewritten as \(D_{r(RTK)}\). \[D_{r}\ \Big{(}D_{\varepsilon},\ D_{f}\Big{)}=\left\{ \begin{array}{l}1\,\ if\ D_{ \varepsilon}>D_{f}\\ 0\,\ otherwise\end{array} \right. \tag{5}\]  
Equation (1) can be rewritten as Equation (6) based on Equation (5). This equation integrates the positioning fusion algorithm and fault detection algorithm for the autonomous application. It allows the strategy process to have a positional reference for planning the control rule to control the vehicle. \[P_{f}=\frac{\Big{(}PD_{f+1}*Wpd\Big{)}+\left(Prtk*Wrtk\right)\ ^{D_{r(RTK)}\ (D_{ \varepsilon},D_{f})}+\left(Pslam*Wslam\right)\ ^{D_{r(SLAM)}\ (D_{ \varepsilon},D_{f})}}{Wpd+\left(Wrtk\right)\ ^{D_{r(RTK)}\ (D_{ \varepsilon},D_{f})}+\left(Wslam\right)\ ^{D_{r(SLAM)}\ (D_{ \varepsilon},D_{f})}} \tag{6}\]