# GNSS Spoofing Identification and Smoothing Localization Method for GNSS/Visual SLAM System
## 3 Time-Localization Verification and Smoothing Localization Method
### Localization Verification Threshold Analysis
\begin{array}{rl}P\{(x_{\rm G},x_{\rm V})\in D\}&=\int_{-a}^{a}\int_{-b}^{b} \frac{1}{2\pi\sigma_{\rm G}\sigma_{\rm V}}\exp\left[-\frac{1}{2}\left(\frac{x_ {\rm G}^{2}}{\sigma_{\rm G}^{2}}+\frac{x_{\rm V}^{2}}{\sigma_{\rm V}^{2}} \right)\right]\mathrm{d}x_{\rm G}\mathrm{d}x_{\rm V}\\ &=\frac{1}{\sqrt{2\pi\sigma_{\rm G}}}\int_{-a}^{a}\exp\left[-\frac{x_{\rm G}^{ 2}}{2\sigma_{\rm G}^{2}}\right]\mathrm{d}x_{\rm G}\cdot\frac{1}{\sqrt{2\pi \sigma_{\rm V}}}\int_{-b}^{b}\exp\left[-\frac{x_{\rm V}^{2}}{2\sigma_{\rm V}^ {2}}\right]\mathrm{d}x_{\rm V}\end{array}  \tag{19}\]According to Equation (17), \((x_{\rm G},x_{\rm V})\) within the confidence interval \(D\) can be regarded as normal values, and \((x_{\rm G},x_{\rm V})\) outside the confidence interval \(D\) is regarded as outliers. Besides, through the Equation (17), the confidence interval \(D\{x_{\rm G}\in(-a,a)\,x_{\rm V}\in(-b,b)\}\) that meets the \(PD\) requirements can be calculated. At this time, the limit error of the GNSS system is \(e_{\rm G}=a\) and the limit error of the visual SLAM system is \(e_{V}=b\). Since the two systems are independent of each other, according to the confidence interval, the confidence probability of the GNSS system \(P_{x_{\rm G}}\) in this range and the confidence probability of the visual SLAM system \(P_{x_{\rm V}}\) in this range can be obtained from  
\[P_{x_{\rm G}}=\frac{1}{\sqrt{2\pi}\sigma_{\rm G}}\int_{-a}^{a}\exp\left[-\frac {x_{\rm G}^{2}}{2\sigma_{\rm G}^{2}}\right]\mathrm{d}x_{\rm G}\,\ P_{x_{\rm V}}=\frac{1}{\sqrt{2\pi}\sigma_{\rm V}}\int_{-b}^{b}\exp\left[- \frac{x_{\rm V}^{2}}{2\sigma_{\rm V}^{2}}\right]\mathrm{d}x_{\rm V} \tag{20}\]  
The PFA and the PMD of the system are related to the setting of the threshold \(E_{d}\). If the threshold is high, it will cause missed detection, and if the threshold is low, it will cause false alarms. When there is no GNSS spoofing, if \(E_{d}\geq\|\chi_{i}^{G}-\hat{\chi}_{i}^{V}\|\), the result of the localization is correct (\(TP\)). On the contrary, if \(E_{d}<\|\chi_{i}^{G}-\hat{\chi}_{i}^{V}\|\), the detection threshold of the GNSS/Vision SLAM system is less than the confidence probability, normal points will be predicted as abnormal points (\(FN\)). According to the principle \"the sum of the two sides of the triangle is greater than the third side\", we get  
\[\|\chi_{i}^{\rm G}-\hat{\chi}_{i}^{\rm V}\|\leq\max\|\chi_{i}^{\rm G}-\chi_{ i}^{0}\|+\max\|\chi_{i}^{\rm V}-\chi_{i}^{0}\|=e_{\rm G}+e_{\rm V} \tag{21}\]  
Therefore, the threshold \(E_{d}\) needs to meet  
\[E_{d}\geq e_{\rm G}+e_{\rm V} \tag{22}\]  
If GNSS spoofing occurs, the spoofing terminal generally has three steps to achieve the purpose of spoofing. First, track and obtain the real satellite signal received by the receiver, perform the calculation, and continue to track the movement of the target. Secondly, when the spoofing terminal considers that the tracking is stable, the spoofing terminal increases the power of the spoofing signal so that the GNSS receiver receives the satellite signal sent by the spoofing terminal. Finally, when the spoofing terminal believes that the high-power signal it sends has replaced the real signal of the GNSS receiver, the spoofing terminal will mix the spoofing information into its high-power signal, so that the receiver will receive the false signal sent by the spoofing terminal and calculate a wrong position. For GNSS forwarding spoofing, the spoofing terminal will add a certain amplitude of spoofing to each satellite signal after tracking the satellite signal received by the GNSS receiver [10].