# Impacts of GPS Spoofing on Path Planning of Unmanned Surface Ships
## 2 Artificial Potential Field
### Modified Artificial Potential Field (APF)  
The traditional APF method has the advantages of simple calculation and effectivity. However, the traditional APF method has the problem of local minimum [29]. Meanwhile, APF for path planning of USV also needs to consider collision avoidance with dynamic TSs, static obstacles, and emergency. The authors [12] proposed a modified APF including the modified repulsion potential field function and the corresponding virtual force to solve the dynamic target collision avoidance. They subdivided the repulsive potential field function according to the requirements of International Regulations for Preventing Collisions at Sea (COLREGS), including dynamic TSs, static obstacles, emergencies, and others, which are shown in the equations based on [12]. This paper focuses on the introduction of APF for dynamic TSs, shown in Figure 3. We have  
\[d_{m}=R_{os}+d_{safe}+R_{ts}, \tag{11}\]  
where \(R_{ts}\) and \(R_{os}\) are the ship domain radiuses of the OS and TS, respectively; \(d_{m}\) is the sum of \(R_{ts}\), \(R_{os}\), and the safe distance between OS and TS (\(d_{safe}\)). We have  
\[\theta_{m}=\arctan\left(\frac{d_{m}}{\sqrt{\rho^{2}(p_{os},p_{ts})-d_{m}^{2}}} \right), \tag{12}\]  
where \(\theta_{m}\) is the angle between the tangent line of the radius circle of \(d_{m}\) and the vector of the OS to the TS. \(p_{ts}\), \(p_{os}\), and \(p_{g}\) are the position of the OS, the Ts, and the goal. \(\rho(p_{os},p_{ts})\) is the Euclidean distance between the OS and the TS. According to the above equations, the modified attractive and repulsive potential function are shown in Equations (13) and (14). \[U_{att}(p)=\frac{1}{2}\xi\rho^{2}(p_{os},p_{g}), \tag{13}\]  
\[U_{rep}(d,\theta)=\left\{ \begin{array}{cc}\eta_{d}R_{ts}(\frac{1}{d-d_{m}}- \frac{1}{\rho_{0}})^{2}(e^{\theta_{m}-\theta}-1)d_{g}^{2},&v_{ts}\
eq 0,d_{m}<d \leq CR\;and\;\theta<\theta_{m}\\ \frac{1}{2}\eta_{s}R_{ts}(\frac{1}{d-\tau}-\frac{1}{\rho_{0}})^{2}d_{g}^{2},&v _{ts}=0,d_{m}<d\leq CR\;and\;\theta<\theta_{m}\\ \eta_{e}R_{ts}\bigg{[}(\frac{1}{d-\tau}-\frac{1}{\rho_{0}})^{2}+(\|V_{to}\| \cos\theta)^{2}\bigg{]}d_{g}^{2},&d\leq d_{m}\\ \hskip 142.26378 ptnot\;defined,&others\end{array} \right., \tag{14}\]  
where \(\rho_{0}\) is the preset influence range of the TS and \(\tau\) is the radius of an artificial safety margin of the OS. \(v_{ts}\) and \(v_{os}\) are the speeds of TS and OS, respectively. \(\theta\) is the angle between the vector \(p_{ot}\) (\(p_{ts}-p_{os}\)) and the relative speed vector \(v_{t}\)\(\sigma\) (\(v_{os}-v_{ts}\)), and \(\|V_{to}\|=\sqrt{v_{os}^{2}-v_{ts}^{2}}\) is the relative speed vector from the OS to the TS. \(d_{g}=\rho(p_{os},p_{g})\), CR is the sum of \(d_{m}\) and \(\rho_{0}\). \(\eta_{d}\), \(\eta_{s}\), and \(\eta_{e}\) are the positive scaling factors for the dynamic the TSs, static obstacles, and emergency action, respectively. \(F_{att}(p)\) is the attractive force in term of the position, shown in Equation (15). \(F_{rep}(d,\theta)\) is repulsive force of the position and the velocities, shown in Equation (19). \[F_{att}(p)=-\
abla[U_{att}(p)]=\xi\rho(p_{os},p_{g}), \tag{15}\]  
\[F_{rd}=F_{rd1}+F_{rd2}+F_{rd3}, \tag{16}\]  
\[F_{rs}=F_{rs1}+F_{rs3}, \tag{17}\]  
\[F_{re}=F_{re1}+F_{re2}+F_{r63}, \tag{18}\]\[F_{rep}(d,\theta)=\left\{ \begin{array}{rl}F_{rd},&v_{ts}\
eq 0,d_{m}<d\leq CR\ \text{and}\ \theta<\theta_{m}\\ F_{rs},&v_{ts}=0,d_{m}<d\leq CR\ \text{and}\ \theta<\theta_{m}\\ F_{re},&d\leq d_{m}\\ not\ defined,&others\end{array} \right., \tag{19}\]  
where \(F_{rd1}\) and \(F_{rd3}\) are the repulsive force from the TS and the attractive force from the goal, respectively, when the obstacles are dynamic TSs. \(F_{rd2}\) is the repulsive force to make the OS alter course to starboard for TS to meet COLREGS requirements. \(F_{rs1}\) and \(F_{rs3}\) are the repulsive force from the obstacle and the attractive force from the goal when the obstacles are static obstacles, respectively.