|
Algorithm 3 Sampling-based Sparse A* Search Algorithm. |
Input: The starting position, the destination position, the search leg length, and the termination condition Output: Coordinates of the waypoints Begin:
-
1:
Empty the open set and the close set;
-
2:
Set the starting waypoint as the first node , add to the open set (), and initialize the number of the explored node ;
-
3:
repeat
-
4:
Select the best node from the open set, move from the open set to the close set;
-
5:
if the termination condition is satisfied at
then
-
6:
Terminate the iteration, then trace back the path up the search tree from until the starting waypoint is reached (return the traced path);
-
7:
end if
-
8:
Expand the search tree from , and obtain the children node set ;
-
9:
for each child node in
do
-
10:
Calculate its distances from the other reached nodes , and select the nearest node from with minimum distance ;
-
11:
if
then
-
12:
This is a node that has been reached before;
-
13:
if
then
-
14:
Replace by ;
-
15:
end if
-
16:
else
-
17:
A new node is obtained, , and add to the open set as ;
-
18:
end if
-
19:
end for
-
20:
until the open set is empty (return failure)
|