# PK-APF: Path-Keeping Algorithm for USVs Based on Artificial Potential Field
###### Abstract  
Path-keeping requires unmanned surface vehicles (USVs) to follow a planned path in autonomous navigation. It is essential for USVs to carry out autonomous tasks such as collecting various data of water quality and surrounding terrain for exploration and protection of water environments. However, due to obstacle avoidance and other factors such as wind, water waves, and dynamics of USVs, USVs usually deviate from the original planned path during autonomous navigation. This paper proposes a novel path-keeping algorithm based on the artificial potential field method (PK-APF) for USVs. To minimize the deviation between the actual path and the original planned path, the vertical distance and the virtual foot points of the current position of USVs to the original path (a line connecting the previous navigation point and the next navigation point) are calculated. When the vertical distance is larger than a threshold, we regard the vertical foot point as a virtual goal point to guide the USVs to navigate the original path in real-time to achieve high-precision path-keeping. Obstacle avoidance is simulated in the MATLAB and Virtual RobotX (VRX) simulators, and the influence of wind and water waves is considered in VRX. Experiments are conducted in typical scenarios and results show that PK-APF outperforms the traditional APF by at least 22%. The work provides an important basis for real-life environments. Substantial further work is planned for applying the method on a physical USV. Keywords:path-keeping; artificial potential field; virtual foot points; USVs; VRX; MATLAB +
Footnote †: journal: Applied Soft  
in path planning is Dijkstra [7], which boasts low search efficiency because it searches the whole map. Compared with Dijkstra, A* uses heuristic functions to estimate the path and reduce the search space, which decreases the search time and is suitable for static environments [8; 9]. The most important design aspect is the determination of the cost function, which defines the weights of the nodes. It is suitable for searching spaces that are mostly known in advance by vehicles, but is costly in terms of memory and speed for large areas. D* [10; 11] is ideal for partially known or continuously changing environments because it is more efficient than A*. Unlike the A* algorithm, D* searches the path nodes by maintaining a priority queue from the goal point until the node reaches the robot's current position. Therefore, the computational effort is reduced when the robot meets other obstacles. Lifelong planning A* (LPA*) algorithm has introduced incremental environment information, which can significantly improve the search efficiency [12]. However, when the environment changes, A*, D*, and LPA* need to completely replan the full path; therefore, these algorithms are inefficient for path planning in dynamic environments. The D* Lite algorithm is based on LPA* and D* [13], which combines heuristic function and incremental search and only considers the path between the current point and the goal point. Therefore, the D* lite algorithm is more efficient than D* and LPA*, and it is widely used for computer games and virtual simulations [14]. Local path planning uses sensors to help USVs detect obstacles in real-time in an unknown environment and transmit information to the USV's controller in time to avoid obstacles [15]. As one of the most commonly used local path planning algorithms, [PERSON] [16] proposed the path planning algorithm of artificial potential field (APF) in 1985. APF has the advantages of simple processing and a high success rate of path planning in an unknown environment. In this algorithm, the whole map is regarded as a potential field, and the robot is regarded as a point in the potential field to avoid obstacles and move towards the goal point. However, APF also has disadvantages, such as falling into local minimum points and low-precision path-keeping.