Skip to main content
. 2022 Nov 28;22(23):9269. doi: 10.3390/s22239269
Algorithm 3 Pseudocode for the complete coverage path planning
  • 1:

    Input: Map, currentPose

  • 2:

    Output: RSTCpath

  • 3:

    determine occupancy grid map based on png map image

  • 4:

    determine spanning tree based on Algorithm 1

  • 5:

    determine the RSTC path based on Algorithm 2

  • 6:

    while it reaches the starting subcell again do

  • 7:

        if unknown obstacle is detected then

  • 8:

            occupy cells in which unknown obstacle is detected

  • 9:

            if exist the unvisited grid cells then

  • 10:

               determine the new spanning tree based on Algorithm 1 for the rest unvisited grid cells

  • 11:

               determine the new RSTC path based on Algorithm 2 for the rest unvisited grid cells

  • 12:

           else

  • 13:

               determine the RSTC path around the obstacle so that the minimum number of double-covered subcells is obtained and connect it with previously planned path

  • 14:

           end if

  • 15:

       end if

  • 16:

       if unknown obstacle cleared occupied cells then

  • 17:

            set these cells as free in the occupancy grid map

  • 18:

            if current cell is diagonal neighbor of the occupied cell then

  • 19:

               add these cells in the previously determined spanning tree

  • 20:

               determine the new RSTC path based on Algorithm 2

  • 21:

            end if

  • 22:

        end if

  • 23:

    end while

  • 24:

    return the RSTC path