# GNSS Spoofing Identification and Smoothing Localization Method for GNSS/Visual SLAM System
## 3 Time-Localization Verification and Smoothing Localization Method
### Localization Verification Threshold Analysis
Then, the equation of the pseudorange \(\hat{\rho}_{i}\) after spoofing becomes  
\[\hat{\rho}_{i}=\sqrt{\left(x_{\rm A}-\left(x_{i}^{\rm S}+\delta_{x}\right) \right)^{2}+\left(y_{\rm A}-\left(y_{i}^{\rm S}+\delta_{y}\right)\right)^{2}+ \left(z_{\rm A}-\left(z_{i}^{\rm S}+\delta_{z}\right)\right)^{2}}+ct_{\rm u_{A} }+\varepsilon_{\rho}(t) \tag{23}\]  
After the GNSS receiver receives the false signal and resolve it, the calculated coordinate of GNSS system becomes \(\hat{\chi}_{i}^{\rm-G}=\left(x_{\rm A}-\delta_{x},y_{\rm A}-\delta_{y},z_{\rm A }-\delta_{z}\right)\). At this time, the localization calculated by the receiver will increase offset of \(\delta_{i}=\left(-\delta_{x},-\delta_{y},-\delta_{z}\right)\). Then, we have  
\[\hat{\chi}_{i}^{\rm-G}=\chi_{i}^{\rm G}-\delta_{i} \tag{24}\]  
where \(\hat{\chi}_{i}^{\rm-G}\) is the GNSS coordinate calculated by GNSS after being spoofed. The forwarding spoofing deviation \(\psi_{i}\) at time \(i\) becomes  
\[\psi_{i}=\|\hat{\chi}_{i}^{\rm-G}-\hat{\chi}_{i}^{\rm V}\| \tag{25}\]At this time, if \(E_{d}<\|\mathbf{\chi}_{i}^{-G}-\hat{\mathbf{\chi}}_{i}^{V}\|\), the spoofing will be identified by our method and the result of the localization is correct (\(T\)N). On the contrary, if \(E_{d}\geq\|\mathbf{\chi}_{i}^{-G}-\hat{\mathbf{\chi}}_{i}^{V}\|\), the detection threshold of the GNSS/Vision SLAM system is too large, the spoofing point will be predicted as a normal point (\(FP\)). According to the principle \"the sum of the two sides of the triangle is greater than the third side\", we get  
\[\|\mathbf{\chi}_{i}^{-\mathrm{G}}-\hat{\mathbf{\chi}}_{i}^{V}\|\leq\|\mathbf{\chi}_{i}^{- \mathrm{G}}-\mathbf{\chi}_{i}^{0}\|+\|\mathbf{\chi}_{i}^{-\mathrm{V}}-\mathbf{\chi}_{i}^{0 }\|=\|\mathbf{\chi}_{i}^{\mathrm{G}}-\hat{\mathbf{\chi}}_{i}-\mathbf{\chi}_{i}^{0}\|+\|\mathbf{ \chi}_{i}^{-\mathrm{V}}-\mathbf{\chi}_{i}^{0}\|\leq\delta_{i}+e_{\mathrm{G}}+e_{ \mathrm{V}} \tag{26}\]  
Therefore, \(E_{d}\) needs to meet  
\[E_{d}<\|\mathbf{\chi}_{i}^{-\mathrm{G}}-\hat{\mathbf{\chi}}_{i}^{V}\|\ \leq\ \delta_{i}+e_{ \mathrm{G}}+e_{\mathrm{V}} \tag{27}\]  
As for the selection of the inducing spoofing threshold \(E_{s}\), the inducing spoofing threshold should satisfy the following equation  
\[\sum_{t=i}^{i+\mathrm{W}}\|\mathbf{\chi}_{t}^{\mathrm{G}}-\hat{\mathbf{\chi}}_{t}^{ \mathrm{Y}}\|<E_{s}<\sum_{t=i}^{i+\mathrm{W}}\|\mathbf{\chi}_{t}^{-\mathrm{G}}- \hat{\mathbf{\chi}}_{t}^{\mathrm{Y}}\| \tag{28}\]  
For inducing spoofing, spoofing terminal usually imposes a small drift which usually does not exceed the accuracy of the GNSS system [22]. At this time, if the limit error of the joint positioning accuracy of the system is considered, it will increase the probability of missed detection because the threshold is too high to detect small drift. Therefore, the inducing spoofing threshold \(E_{s}\) needs to be greater than the cumulative standard deviation of the system (\(\sigma\) is the standard deviation of the GNSS/Visual SLAM system) and less than the cumulative limit error of the system. \[E_{s}\geq\mathrm{W}\cdot\sigma_{\mathrm{G}}\,E_{s}\geq\mathrm{W}\cdot\sigma_{ \mathrm{V}}\,E_{s}\geq\mathrm{W}\cdot\sigma_{\mathrm{GV}}\ \text{and}\ E_{s}<\mathrm{W}\cdot(e_{ \mathrm{G}}+e_{\mathrm{V}}) \tag{29}\]  
Normally, we do not know the value of the spoofing signal, so we choose  
\[\|\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}\]0  
It can be seen that the value of the localization threshold is related to the positioning performance of the sensors and the window size. In Section 4, we conduct a simulation analysis on the selection of the threshold according to the positioning performance of the selected sensor and the window size.