## 3 Depth Safety Path Planning Method
### Path Planning Algorithms Considering Depth Hazard  
According to the results of the hydrodynamic analysis in Section 3.1, the minimum water depth required for safe navigation of unmanned surface vehicles is calculated by Equation (11):  
\[S_{\min}=z_{\max}+0.5L\tan\theta_{\max}+\overline{T}+e_{enc}, \tag{11}\]  
where, \(z_{\max}\) is the largest downward settlement of the USV in several irregular waves at different speeds, \(L\) is the length of USV, \(\theta_{\max}\) is the maximum trim angle, \(\overline{T}\) is the average draft of the USV, and \(e_{enc}\) is the depth error of ENC are considered. According to the minimum safe water depth for an unmanned surface vehicle, the restricted sea area of the unmanned surface vehicle is calculated, and the obstacle region is updated. The cost of water depth hazard in the obstacle region is set to 1. Define the depth hazard of nodes \(N_{i}\) in feasible space as follows:  
\[r(N_{i})=\frac{S_{\min}}{D(N_{i})},(0<r(N_{i})<1), \tag{12}\]  
\(D(N_{i})\) is the average water depth of each grid calculated by the interpolation algorithm in Section 2.2. Total depth hazard of planned path is calculated by Formula (13):  
\[R_{s}=\sum_{i=1}^{N}r(N_{i}), \tag{13}\]  
where, \(i\) is the index of the grid through which the path passes, and \(N\) is the total number of all the grids through which the path passes. The depth hazard distribution map calculated by the combination of depth area and Formulas (11)-(13) is shown in Figure 9. The depth hazard map will be used as the input map of the path search algorithm. The depth risk map and A* algorithm are applied to plan the path. A* algorithm was proposed originally by [PERSON] et al. [9]. The algorithm searches the minimum cost path from the starting node to the terminating node through the minimum cost function (15),  
\[h(N_{i}) = \sqrt{\left(x_{N_{i}}-x_{G}\right)^{2}+\left(y_{N_{i}}-y_{G} \right)^{2}}, \tag{14}\] \[f(N_{i}) = g(N_{i})+h(N_{i}), \tag{15}\]  
Figure 9: The depth hazard distribution map. where \(g(N_{i})\) is the actual distance cost from the ith node \(N_{i}\) to the starting node S that has been paid in the raster map namely the distance traveling from the start node S to the \(i\)th node \(N_{i}\). \(h(N_{i})\) is the heuristic distance from the start node to the goal node which has a great influence on the performance of A* algorithm, in which \((x_{N_{i}},y_{N_{i}})\) is the coordinate the center of node \(N_{i}\) and \((x_{G},y_{G})\) is the coordinate the center of goal node G. If it is always lower than (or equal to) real value, the shortest path can be found. The lower the number of extended nodes is, the slower the search speed. If it is equal to the actual value, the search only follows the best path and does not expand the redundant nodes, so the search speed is the fastest. If it is larger than the actual value, the shortest path cannot be guaranteed, but the search path is faster. In this paper, the Euclidean distance is chosen as a heuristic value when calculating the shortest distance path. Euclidean distance can ensure that the solution can be found if there is a shorter path. The shortest path planned by A* algorithm combined with the grid method is presented in Figure 10.  
The heuristic function of A* algorithm considering depth hazard degree is defined as:  
\[f(N_{i})=g(N_{i})+h(N_{i})+\alpha\sum\limits_{i=1}^{N_{i}}r(N_{i}) \tag{16}\]  
Not only the distance cost should be considered, but also the depth hazard, and the nodes with lower depth hazard degree should be selected to expand in neighbor nodes when expanding nodes. In Formula (14), \(g(N_{i})\).