# PK-APF: Path-Keeping Algorithm for USVs Based on Artificial Potential Field
## 3 Experiments
### High-Fidelity ROS Simulation
#### 3.2.3 Simulation Result and Discussion  
The PK-APF and APF are validated using high-fidelity simulations with water wave, wind, and USV dynamics. We compare the traditional APF and PK-APF for different wind speed scenarios at the approximate 100 \(\times\) 100 m\({}^{2}\) area. The paths of the simulated results are shown in Figure 12.  
The experiments show that the planner successfully navigates the USV from the start point to the goal point using APF and PK-APF at different wind speeds. Without the wind disturbance, Figure 12a,c show that both algorithms can avoid the obstacle. The APF in Figure 12a moves to the goal point directly while PK-APF in Figure 12c moves to the original path first, then toward the goal point. This is the reason why the total distance of APF is less than that of PK-APF. The PK-APF can guide the USV to return to the original path after avoidance. For Figure 12b,d, the result demonstrates that PK-APF is robust to keep the path with wind disturbance, while APF deviates from the original planned path. The USV does not fall into local minimum point due to wind, water waves, and the USV's inertia and temporal force. However, we observe that the path overshoots a few meters due to inertia. For Figure 12c,d, the result shows that PK-APF can achieve path-keeping and obstacle avoidance with wind disturbances.  
We plotted the error between the USV position and desired straight-line path. PK-APF achieved better path-keeping compared with traditional APF. Figure 13 indicates the path-keeping error of four experiments. At the time step between 100 and 200, PK-APF  
Figure 11: Simulation framework.  
Figure 12: Planned and original paths for APF and PK-APF with different wind disturbances.  
tracks desired path within 0.5-m error while APF tracks straight path with about 10-m error. Particularly, APF in the windy environment has a significant deviation due to wind disturbances. At the time step between 200 and 325, the USV detected the obstacle. Both PK-APF and APF successfully guide the USV to avoid obstacles. After avoiding maneuver, the PK-APF enables path-keeping quickly. When the USV exits the repulsive force influence range, the path of PK-APF slightly overshoots approximately 2 m to keep the desired path.  
Figure 14 shows the statistics of path-keeping errors. The medians of path-keeping error are from 2.0 to 8.0 m for APF at wind speeds of 0 and 5.9 m/s, and from 0.2 to 0.9 m for PK-APF at wind speeds of 0 and 5.9 m/s, respectively. The maximum relative path-keeping errors at wind speeds of 0 and 5.9 m/s are from 16.4 to 16.8 m for APF, and from 4.5 to 5.9 m for PK-APF, respectively. PK-APF reduces 64.9% maximum relative path-keeping error compared with APF without wind, and 72.6% under wind disturbance.  
In short, the proposed PK-APF algorithm demonstrates a robust path-keeping ability and obstacle avoidance function even under external disturbances such as obstacle avoidance, wind, and water wave, which enables wide applications for USVs such as riverbed modeling tasks and meshed voyages for water sampling.