## 6 Simulation of Dynamic Collision Avoidance Algorithm
### Simulation Verification for Collision Avoidance  
In order to verify the collision avoidance ability of the USV in a multi-obstacle scene, the real electronic chart in Figure 9 was taken as the simulation scene. Table 3 shows the motion information of the USV and obstacles, with the coordinate unit m and velocity unit kn. The numerical simulation was carried out on the Lanxin USV of Dalian Maritime University, for which principal parameters can be found in [33]. The initial conditions of the USV were \(\{x,y,\psi,u,v,r\}(0)=\{0\) m, \(280\) m, \(0\) rad, \(0\) m/s, \(0\) m/s, \(0\) rad/s\(\}\). The control parameters were selected as \(\kappa=1,\
abla=1\), \(K_{p}=diag\big{(}1.0\times 10^{3},1.0\times 10^{3}\big{)}\), \(K_{i}=diag\big{(}0.3\times 10^{3},0.3\times 10^{3}\big{)}\) and \(K_{d}=diag(20,20)\). \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Function** & **Algorithm** & **Optimal Solution** & **Worst Solution** & **Average Value** \\ \hline \multirow{3}{*}{Sphere} & PSO & \(1.1812\times 10^{-8}\) & \(8.6634\times 10^{-7}\) & \(2.1987\times 10^{-7}\) \\  & CS & \(1.1803\times 10^{-6}\) & \(1.3057\times 10^{-5}\) & \(5.0170\times 10^{-6}\) \\  & ICS & \(1.7019\times 10^{-19}\) & \(2.8024\times 10^{-18}\) & \(1.1439\times 10^{-18}\) \\ \hline \multirow{3}{*}{[PERSON]} & PSO & \(8.9423\times 10^{-7}\) & \(5.4106\times 10^{-5}\) & \(2.0311\times 10^{-5}\) \\  & CS & \(2.2135\times 10^{-8}\) & \(2.6034\times 10^{-6}\) & \(4.1700\times 10^{-7}\) \\  & ICS & \(8.8818\times 10^{-16}\) & \(2.2204\times 10^{-14}\) & \(8.7041\times 10^{-15}\) \\ \hline \multirow{3}{*}{[PERSON]} & PSO & \(9.6883\times 10^{-4}\) & \(0.0494\) & \(0.0198\) \\  & CS & \(0.0020\) & \(0.0272\) & \(0.0115\) \\  & ICS & \(0\) & \(8.1406\times 10^{-12}\) & \(8.6685\times 10^{-13}\) \\ \hline \multirow{3}{*}{Schaffer} & PSO & \(2.4826\times 10^{-9}\) & \(0.0097\) & \(0.0058\) \\  & CS & \(8.4831\times 10^{-8}\) & \(0.0097\) & \(0.0051\) \\ \cline{1-1}  & ICS & \(5.7732\times 10^{-15}\) & \(1.6292\times 10^{-6}\) & \(3.2832\times 10^{-7}\) \\ \hline \end{tabular}
\end{table} 
Table 2: Simulation results of test functions. \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & **Starting Point** & **Target Point** & **Direction** & **Velocity** \\ \hline USV & (0, 280) & (900, 800) & \(90^{\circ}\) & \(30\) \\ \hline Obstacle 1 & (590, 120) & & \(270^{\circ}\) & (\(-17\), 0) \\ \hline Obstacle 2 & (500, \(-80\)) & & \(0^{\circ}\) & (\(0\), 10) \\ \hline Obstacle 3 & (1100, 520) & & \(270^{\circ}\) & (\(-12\), 0) \\ \hline Obstacle 4 & (760, 1050) & & \(180^{\circ}\) & (\(0\), \(-10\)) \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Data for multiple dynamic obstacle avoidance. Figure 9: Chart scene. The collision avoidance simulation for the USV in a multi-obstacle scene is shown in Figure 10, in which the blue trajectory is the collision avoidance route of the USV, and the other trajectories are those of dynamic obstacles. In Figure 10, the USV detects whether there is an obstacle at any time during its voyage. In Figure 10a, the USV detects that it meets obstacle 1 and completes the obstacle avoidance by maintaining course \(-39^{\circ}\). In Figure 10b, the USV detects the crossing obstacle  
Figure 10: Multiple dynamic obstacle avoidance. (**a**) Encounter obstacle 1; (**b**) Encounter obstacle 2; (**c**) Encounter obstacle 3; (**d**) Encounter obstacle 4; (**e**) Leave obstacle 4; (**f**) Achieve the goal.