Skip to main content
. 2020 Nov 3;20(21):6270. doi: 10.3390/s20216270
Algorithm 1 Registration of new nodes by frontier segmentation
  • Require: 

    current local grid map gridmapcur, frontier-graph database Node=nodeid|1idN, Edge, Map=mapid|1idM1, size of window for detecting safe frontier cells window_size

  • Ensure: 

    updated frontier-graph database, Node,Edge,Map

    ▹ The algorithm assumes that the current node is noden, the parent node is noden2, and the previous node is noden1. noden and noden1 are siblings to each other. The map IDs of the parent node and previous node are M2 and M1.

1: add mapM=M,gridmapM,M,0,0,0Tinto Map
2: obtain gridmapmg by merging the adjacent local maps, mapM2, mapM1, mapM,
3: gridmap_frontier Detect-Frontier-Cell gridmapcur,window_size
   ▹RowSize is the number of rows gridmap_frontier and gridmapcur.
   ▹ColSize is the number of columns gridmap_frontier and gridmapcur.
4: for r=1 to RowSize do
5:     for c=1 to ColSize do
6:         if gridmap_frontierr,c=1 then
7:            rmg,cmgTcell_coordinate_transformr,cT,gridmapcur,gridmapmg,Edge
8:            if Inspect-Safe-Frontier-Cellrmg,cmgT,window_size,gridmapmg=0 then
9:                gridmap_frontierr,c0
10:            end if
11:         end if
12:     end for
13: end for
14: frontier_segmentconnected_component_labelinggrifmap_frontier
15: if frontier_segment then
16:     relative_trans
17:     new_Node
18:     for all frontierifrontier_segment do
19:         nodeidnew,trn,idnewInitialize-New-Nodefrontieri,n,idnew
20:         new_Nodenew_Nodenodeidnew
21:         relative_transrelative_transtrn,idnew
22:     end for
23:     Edgenewcalculate_edgenoden,new_Node,relative_trans,gridmapcur
24:     new_Node_orderedTSPnoden,new_Node,Edgenew
25:     update_node_DBNode,new_Node_ordered
26:     update_edge_DBEdge,Edgenew
27: end if