Introduction

In the military and civilian fields, with the rapid development of technology, unmanned surface vehicle (USV) is increasingly used to perform various tasks such as target search, post-disaster personnel search and rescue, surface warning, and security patrol (Kim and Lee, 2019). During the movement, disturbed by various obstacles, USV may not be able to search for as many targets as possible or the coverage of the map is too low, which cannot meet the requirement of search task. So, a better path planning method of USV is the key to complete the search task. The path planning problem of USV can be modeled as a constrained optimization problem including tasks such as path planning and obstacle avoidance.

Target search is an indispensable part of most tasks performed by USV. The main purpose of path planning based on target search is to search for as many targets as possible while increasing the coverage of the map. In the process of increasing the coverage rate of searching target, the designed search paths of USV should be overlapped as less as possible to achieve the effect of searching for the target as soon as possible. Galceran and Carreras propose a parallel search strategy of target searching, which can achieve the complete coverage of the search area, but the path of searching is too long (Galceran and Carreras 2013). Nasr propose a multi-scroll chaotic system to avoid the redundancy of orbits. At the boundary conditions, in order not to leave the workspace, a mirror mapping method is utilized, which constrains all the mobile robot positions in the workspace and which can reflect all the overflow waypoints returning to it. Compared with simply using the double-scroll chaotic systems in the whole workspace, the suggested new multi-scroll chaotic system, combined with the mirror mapping method, shows good results that can achieve a higher coverage for a larger workplace of the mobile robot (Nasr et al. 2019). The above path planning strategies can fulfill the requirements of covering the entire search area, but still need to be improved for search efficiency.

When USV travels on the planned path, it often encounters obstacles. To ensure safe driving, it is necessary to avoid obstacles. Common path planning algorithms for avoiding obstacles include Dijkstra algorithm (Zhou 2019), A* algorithm (Zhou et al. 2013) and artificial potential field method (Zhang 2018), grid method (Lee et al. 2011), firefly algorithm (Patle et al. 2018), and genetic algorithm (Jiang et al. 2014). Among the abovementioned algorithms, the A* algorithm is a more effective method for solving the shortest path and is also a suitable obstacle avoidance algorithm for USV. Singh proposes an A* approach with an USV enclosed by a circular boundary as a safety distance constraint on generation of optimal waypoints to resolve the problem of motion planning for an USV moving in a maritime environment. The proposed approach is effective for global path planning of USVs (Singh et al. 2018). A collision-free path planning method based on improved A* algorithm for automatic guided vehicles (AGVs) logistics sorting system is proposed by Yuan et al. In the method, the environment of warehouse operation for AGVs is described by using grid method. The estimated cost of A* algorithm is improved by adding the penalty value of the paths that AGVs share with each other to alleviate traffic congestion and collision resolution rules are made according to different types of collisions. The new collision-free path planning method can improve the sorting efficiency of multi-AGVs system and relieve traffic congestion (Yuan et al. 2016). In view of the low time and space utilization of the traditional A* algorithm, Yao and Lin improve the traditional A* algorithm not only by weighting the evaluation function, but also by reducing the search step and the search time in the feasible path planning (Yao et al. 2010). Among the several A* algorithms mentioned above, the traditional A* algorithm is improved, which shortens the search time and optimizes the search path to a certain extent, but these algorithms do not take into account the cost of turning. In this paper, the traditional A* algorithm is improved. By increasing the cost of turning in the evaluation function, the A* algorithm reduces the number of turning in the process of path finding, and further optimizes the search path.

Aiming at the shortcomings of existing path planning methods, this paper proposes a path planning algorithm of USV for intelligent target search, which combines global path planning with local path planning and improves the efficiency of search targets. It increases the map coverage of USV, and considering the cost of USV turning, adds the turning cost to the evaluation function, improves the A* obstacle avoidance algorithm and saves resources.

This paper is organized as follows: Firstly, the global path planning based on prior information is introduced, which can search the target area by expanding spiral trajectory; secondly, the local path planning based on real-time information is introduced, and the quick confirmation of suspicious targets is achieved by switching automatically among three modes; thirdly, the traditional A* path planning algorithm is introduced, and the A* algorithm is improved by reducing turning times. Then, the algorithm proposed in this paper is simulated. Finally, a conclusion is drawn.

Global Path Planning Based on Prior Information

The global path planning of USV is a large-scale and long-endurance path planning, which can be defined as based on the prior information provided by electronic charts, comprehensive consideration of operational tasks and their own navigation characteristics plan a non-touch path from the starting point to the target (Xia et al. 2019).

Parallel search is one of the most commonly used strategies in global path planning. The search trajectory is parallel and covers the area to be searched by circular trip. However, the parallel search has the limit of turning, which makes USV at high speed and has safety risk. Since the center of the area to be searched has the largest probability to find the target, searching for the target from the center of the area by the expanding spiral trajectory can find the target as quickly as possible. Theoretical analysis shows that the distance between two adjacent turns of the expanding spiral is equal; then, twice sensor target sensing distance can be used as this distance, so that the search area can be searched without repetition. At the same time, considering the safety factor, USV should keep running smoothly when performing the target search task. While USV driving along the straight line, it does not turn, and the turning angle is small when driving along the expanding spiral trajectory, so straight line plus spiral is selected as a global search path in the proposed algorithm. Therefore, the proposed algorithm enables USV to quickly reach the center of the search area along the straight line and then search along the expanding spiral trajectory.

As depicted in Fig. 1, in order to quantify the comparison between extended spiral path and parallel search path, this paper takes 100 target points which obey two-dimensional normal distribution on the coordinate map and makes a parallel search path and extended spiral path cover the search area. The green points in the graph are the target points, the blue points form parallel search paths, and the red points form extended spiral paths. The average driving distances by the two methods are calculated respectively when the USV detects all the targets through simulation experiments. The experimental results are depicted in Table 1; the average driving distance of spiral path is far less than that of parallel search. By expanding the spiral path, the target can be searched faster. The mean value of two-dimensional normal distribution is [50, 50] and the covariance is [100 80; 80 100]. These parameters are derived from the empirical values in a real USV.

Fig. 1
figure 1

Comparison of parallel search and extended spiral search

Table 1 Comparison of parallel search and extended spiral

Before USV departs, it is necessary to carry out global path planning based on the starting point and the area to be searched, then find the center based on the search area range which is considered the position with the highest probability of occurrence of the target. First, plan a straight line path from the starting point to the center of the search area, approach the most likely position of the target in the fastest way, then plan an expanding spiral trajectory consisting of planning points separated by the same angle base on the center of the search area, until the range of spirals can cover the entire search area. When planning the expanding spiral trajectory, first, based on region range of search area, the radius R and the center of the circumcircle of the search area are calculated; then, the R is used as the maximum radius of the expanding spiral trajectory and the center is used as the starting point of expanding spiral trajectory; finally, the Archimedes spiral formula is applied to generate an expanding spiral trajectory, which covers the entire search area. The Archimedes spiral formula is depicted in Eq. (1):

$$ \Big\{{\displaystyle \begin{array}{c}x=\left(\alpha +\beta \theta \right)\cos \left(\theta \right)\\ {}y=\left(\alpha +\beta \theta \right)\sin \left(\theta \right)\end{array}} $$
(1)

where x is the abscissa of the planning point, y is the ordinate of the planning point, θ is the polar angle of the current circumference, α is the distance from the starting point of the spirals to the origin of the coordinate, and β is the increase of the radius per radian. The larger β, the greater the distance between two adjacent turns. According to Eq. (2), the number of spiral coils covering the search area can be calculated as n:

$$ n=R/\left(2\times \uppi \times \beta \right) $$
(2)

The schematics of the global path planning is depicted in Fig. 2. As can be observed from the figure, USV reaches the center of the area to be searched along a straight path, then starts to search outward with an expanding spiral trajectory. The black square in the figure is the obstacle coverage area acquired by the prior information of electronic charts. If a portion of the planning path points is in the obstacle coverage area, then these points are deleted so that all planning points are in a position where USV can actually reach.

Fig. 2
figure 2

Sketch of global path planning

This paper improves the planning method of global path planning, completes the search of the target area by expanding spiral trajectory and makes the whole motion process more stable and safer. The prior information provided by the electronic chart can help in avoiding the known obstacle area, which ensures the safe driving of USV. At the same time, the coverage of the map is increased, the search efficiency is improved, and resources are saved.

Local Path Planning Based on Real-Time Information

Global path planning is to plan a safe and feasible path based on prior information. However, when USV is sailing at sea, it will encounter various situations. In this situation, global path planning alone cannot meet the requirements of actual target search. Therefore, we need to carry on local path planning in real time according to the complex and changeable situation. Local path planning is guided by global path and uses real-time local environment information to quickly confirm suspicious targets (Liu et al. 2019).

When USV detects the suspicious target, it enters into the local path planning, which takes the current position of USV as the starting point, and approaches the suspicious target in a faster way for further confirmation. According to the different states of USV, three different local path planning modes are designed, which are approaching suspicious target path planning mode, shrinking spiral path planning mode, and circular path planning mode. During the whole target search task, the automatic switching of these three modes can ensure that the target is detected quickly.

Approaching Suspicious Target Path Planning Mode

When USV detects a small probability suspicious target, it needs to be further close to the suspicious target for confirmation. Because straight line is the fastest approach method, approaching suspicious target path planning mode is designed based on characteristics of straight line, in which the midpoint between the current position of USV and suspicious target is regarded as a planned point. As depicted in Fig. 3, the current position of USV is point A. Through coordinated work of multiple sensors, the position of suspicious target is determined to be point B. Planned point C is at the midpoint of point A and point B. The coordinate of point C (x1, y1) are calculated by Eq. (3), where (x, y) is the current position of USV, (x0, y0) is the suspicious target position;

Fig. 3
figure 3

Sketch of approaching suspicious target path planning

$$ \Big\{{\displaystyle \begin{array}{c}{x}_1=\frac{\left({x}_0+x\right)}{2}\\ {}{y}_1=\frac{\left({y}_0+y\right)}{2}\end{array}} $$
(3)

Shrinking Spiral Path Planning Mode

When USV detects the large probability target, we need to approach the suspicious target and observe the suspicious target from different angles. The shrinking spiral path planning can meet the above two requirements simultaneously, so that USV moves around the suspicious target and gradually approaches the suspicious target for further confirmation. Taking the suspicious target position as the center of the shrinking spiral and the distance between the current position of USV and the target as the maximum radius of the shrinking spiral, the coordinate of the planned points of the shrinking spiral path are calculated according to Eqs. (1) and (2). As depicted in Fig. 4, USV is getting closer and closer to the suspicious target so as to observe the suspicious target from different distances and angles.

Fig. 4
figure 4

Sketch of shrinking spiral path planning

Circular Path Planning Mode

In USV target search task, if the target has been confirmed, it is necessary to monitor the target and wait for the next instruction of the control center. Monitoring target requires USV to move around the target without losing the target, and circular path is a better way to achieve the above requirements. The circular path planning sketch is depicted in Fig. 5. In this mode, taking the target as the center of the circle and the distance between the current position of USV and the target as the radius, the circular path is planned. In movement process of USV, if the target deviation exceeds a certain range, the circular path is re-planned according to the above method to ensure that the target is always within the scope of USV surveillance.

Fig. 5
figure 5

Sketch of circular path planning

According to the different states of USV, three different local path planning modes are designed in this paper. After discovering the suspicious target with small probability, we can approach the suspicious target quickly by approaching suspicious target path planning mode. After discovering the suspicious target with large probability, we can observe the suspicious target from different distances and angles by shrinking spiral path planning mode. After confirming the target, we can monitor the target by circular path planning mode and wait for the next instruction, through the combination of the three modes to complete the local path planning, in order to achieve rapid confirmation of suspicious targets.

Improved A* Obstacle Avoidance Algorithm

In global path planning and local path planning, the distance between adjacent planned points is relatively long. In the process of moving from one planned point to the next planned point, real-time obstacles are often encountered. In this situation, the former planned point can be used as the origin node of the improved A* algorithm, and the latter planned point can be used as the ending node of the improved A* algorithm. So in this paper, improved A* algorithm is used to plan the path to avoid obstacles between two planned points.

Environment Model

Set the current map area as G and build a two-dimensional grid map. The starting and ending points correspond to two adjacent points in global or local path planning, respectively.

By storing the information of grid map in matrix, the element G(i, j) in the matrix is the mapping of the node state of the i row and the j column of the grid map. For each element in matrix, 1 represents that the current node is not passable and 0 represents that the current node is passable. The sketch of grid map is depicted in Fig. 6. The black grid represents the obstacle area, and the rest of the grid represents the accessible area. Using the method of one-to-one correspondence between the matrix and the grid, the two-dimensional grid map can be modeled (Jiang et al. 2019).

Fig. 6
figure 6

Sketch of grid map

Basic Principle of A*

The A* algorithm is a heuristic path search method, it makes use of a heuristic evaluation function (Eq. (4)) as a label for node n, where g(n) is the travel time of the current evaluated path from origin node to node n and h(n) is an estimated travel time from node n to ending node. The sum of these two functions, f(n), is the “merit” of node n and reflects how likely it is for node n to be on the shortest path. The lower the merit of a node, the more likely the shortest path will go through this node. Based on this idea, the algorithm does a best-first search. It places all encountered nodes in two lists: open and closed. The open list records all the nodes that have been encountered but not traversed as the current node. The traversed nodes are placed in the closed list. At the beginning, the open list has only one origin node and the closed list is empty (Fu et al. 2006). For each iteration, the algorithm selects the smallest f(n) value node from the open list. The algorithm is then executed as the current node and removed from the open list and placed in the closed list.

$$ f(n)=g(n)+h(n) $$
(4)

Because of h(n), A* algorithm has the potential of heuristic search. So how to select the h(n) is very important for A* algorithm. The h(n) used in general A* algorithm is Manhattan distance (Hart et al. 1968). The calculation method is depicted in Eq. (5):

$$ h(n)=\mid {x}_d-{x}_c\mid +\mid {y}_d-{y}_c\mid $$
(5)

where xd denotes the coordinate of the X-axis direction of the target, yd denotes the coordinate of the Y-axis direction of the target, xc denotes the coordinate of the X-axis direction of the current point, and yc denotes the coordinate of the Y-axis direction of the current point.

Improved A* Algorithm

Compared with the traditional BFS (breadth-first search) and DFS (depth-first search) (Banerjee et al. 2018) blind search algorithms, A* algorithm is more efficient because it is a heuristic search algorithm. The A∗ algorithm has a similar procedure as the Dijkstra except that the evaluation function f(n) would be used as the label, instead of g(n). Dijkstra algorithm identifies the ending node for each connection and stores the total cost of its path so far (i.e., g(n), it takes g(n) as the label. The A* algorithm stores the total estimated cost f(n) from the origin node to the ending node, in addition to the total cost g(n). This estimate f(n) is the sum of g(n) and the estimated cost h(n) from the current node to the ending node. f(n) is called the heuristic value of nodes, which is non-negative. Generating heuristic value is the key of A* algorithm. That is to say, A* algorithm adds constraints to guide its way towards the goal. In the case of meeting feasibility and monotony, the algorithm can also get the optimal solutions.

However, the traditional A* algorithm does not take into account the cost of turning in the path. As depicted in Fig. 7, the extended node sketch shows that node A is the origin node, node E is the ending node, node C is the current position of USV, black grid is not passable, and gray grid is passable. In the traditional A* algorithm, for the current node C, sub-nodes P and Q with the same value of evaluation function have the smallest value of evaluation function among all sub-nodes of node C. The traditional A* algorithm is to select the node with the smallest evaluation function in the open list table. When the two evaluation functions are equal, the nodes are selected according to the order of entering the open list table. However, according to life experience, the cost of turning cannot be neglected, especially for USV moving on the windy sea, turning will lead to unstable motion of USV, and increase the energy consumption of USV. Therefore, we establish an optimization model of turning angle and energy cost, the model e(n) is depicted in Eq. (6).

Fig. 7
figure 7

Sketch of extended nodes

$$ \mathrm{e}(n)=\upgamma \times \frac{\mathrm{angle}}{45} $$
(6)

γ is an influence factor to control the cost of turning, and angle is the angle of turning. When the planned path turns 45°, the cost of turning is γ. Because this paper is based on an USV project, in this project, the energy consumption of turning 45° is 0.5 times that of driving 100 m, so the value of γ is 0.5 in this paper. The improved evaluation function is depicted in Eq. (7), its distance unit is 100 m, which normalizes the energy consumption of USV driving 100 m to 1.

$$ F(n)=g(n)+h(n)+\mathrm{e}(n) $$
(7)

The angle between the direction from node A to current node C and the direction from current node C to the next sub-node (P or Q) is calculated, respectively. Based on this, the evaluation function F(n) is recalculated for all valid sub-nodes and the sub-node with the smallest F(n) is selected in the open list table. The schematic sketch of extended nodes is depicted in Fig. 7. Compared with USV passing through node P to node E, USV passing through node Q to node E along its original direction decreases a one-step turning process leading to saving energy. Therefore, the cost of turning e(n) is added into the design of the evaluation function to reduce the number of turning times of the planned path, so as to achieve the purpose of saving resources.

Analysis of Simulation Experiment

In traditional target search path planning, parallel search is adopted, which results in low search efficiency. In this paper, the global path planning and local path planning are combined into the target search, which not only covers the search range, but also greatly improves the search efficiency. In order to verify the performance of global path planning and local path planning, the following experiments are carried out. As depicted in Table 2, the initial parameters of USV path planning are set. The starting point of USV is (119, 24), the center of the area to be searched is (119.02, 24.02), the searching radius is 1000 m, the suspicious targets can be classified as fake target and real target, the fake target location is (119.03, 24.01), and the real target location is (119, 24.02). According to the initial parameters, the global and local path planning results are simulated using the simulation platform of MatlabR2018a. The simulation results are depicted in Fig. 8.

Table 2 Initial parameter table of USV path planning
Fig. 8
figure 8

Simulation results of USV path planning

From Fig. 8, we can see that the linear path is planned between the departure point and the center point of the region to be searched through global path planning, and then the expending spiral planning begins at the center of the region to be searched to cover this region. When USV arrives at the point (119.025, 24.016) in the global path, a suspicious target is found at (119.03, 24.01). At this time, USV enters approaching suspicious target path planning mode of local path planning. The midpoint between the current position of USV and the suspicious target is regarded as the planned point. When USV arrives at the planned point, after further detection, the suspicious target is confirmed as the fake target, then USV returns to the global path and continues to perform the search task. When USV arrives at the point (119.012, 24.02), another suspicious target is found, which is located at (119, 24.02). Then USV enters approaching suspicious target path planning mode of local path planning, and further detects the suspicious target. When the suspicious target is detected as a large probability target, USV enters shrinking spiral path planning mode, and detects the suspicious target multiple times at different distances and angles. After repeated confirmation, the suspicious target is a real target, then USV enters the circular path planning mode, which makes USV move around the target and ensures that the target has been monitored by USV. Within the control range, USV waits for the next instruction of the control center.

Compared with the parallel search method, the search method combining global path planning and local path planning proposed in this paper expands the search from the center of the area to be searched to the surrounding area, first USV searches the place with highest probability of the target, so as to achieve the requirement of fast search to the target; after detecting the suspicious target, it enters the local path planning mode, then approaches suspicious targets quickly and confirms repeatedly. In this way, the search efficiency is greatly improved.

The distance between any two adjacent planned points in the planned path of USV in Fig. 8 is relatively long, so that obstacle may appear in real time. Therefore, in the process of moving from one point to the next point, obstacle avoidance path planning algorithm is needed. Following, we use the simulation platform of MATLAB R2018a to compare the traditional A* algorithm with the improved A* algorithm.

In the improved A* algorithm proposed in this paper, the cost of turning is added to the evaluation function. Let the cost of moving one square in each horizontal and vertical direction be 1, the cost of moving one square in the diagonal direction is 1.4, the cost of turning increases by 0.5 with the turning angle increases by 45°. Figures 9 and 10 are the planned paths of the traditional A* algorithm and the improved A* algorithm, respectively. The upper left corner of the graph is the origin point, the gray square is the ending point, the white area is passable, and the black area is not passable.

Fig. 9
figure 9

the planned path of the traditional A* algorithm

Fig. 10
figure 10

the planned path of the improved A* algorithm

Comparing Figs. 9 and 10, it can be observed that at the two sub-nodes with the same f(n), the traditional A* algorithm will choose the lower nodes as the optimal sub-nodes, while the improved algorithm will choose the upper nodes as the sub-nodes along the original direction of the path to reduce the turning times. Giving the same origin point and the same ending point, as depicted in Table 3, the turning cost of path planned by the traditional A* algorithm is 15.5, and the total cost of path is 59.3. the turning cost of path planned by improved A* algorithm is 10.5, and the total cost of path is 54.3. It can be clearly observed that the improved A* algorithm reduces the turning cost of path, reduces the total cost of the path, and the decrease of the turning cost can make the whole motion process more stable and safer.

Table 3 Total cost of path and turning cost of two algorithms

In this paper, the computational performance of the traditional A* algorithm and the improved A* algorithm is tested on VS2017 platform, the hardware used is i5-6300HQ CPU. As depicted in Table 4, the running time of the traditional A* algorithm is 116 ms and that of the improved A* algorithm is 124 ms. The computational performance of the improved algorithm is only 6% lower than that of the traditional algorithm. It can still achieve real-time planning without affecting the practical application of USV path planning.

Table 4 The computational performance of two algorithms

Conclusion

In this paper, a path planning algorithm for USV in intelligent target search is proposed, which includes global path planning based on prior information, local path planning based on real-time information and improved A* obstacle avoidance algorithm. During the process of searching, with the change of USV’s status, the global path planning and three local path planning modes are automatically switched to cope with various situations arising from the searching task. And the improved A* algorithm which adds the turning cost to the evaluation function makes the path between two planned points more efficient and safer. Comprehensive analysis shows that the proposed path planning algorithm for USV in intelligent target search not only improves the efficiency of target search, but also saves resources.