Skip to main content
. 2021 Jun 28;21(13):4414. doi: 10.3390/s21134414
Algorithm 2 Trajectory planning using Fast Marching Square
  •   

    functionGenerate_new_mission(dronePos, depotPos, Warray)

  • 2:

      if New outbound mission then

            Initial pointdepotPos

  • 4:

            Final point← Randomly chosen point of free space

        else

  • 6:

            Initial pointdronePos

            Final pointdepotPos

  • 8:

        end if

        Assign flight level according to flight direction

  • 10:

      W← Viscosity map from Warray according to flight level

      Determine intermediate point at depot and flight level height

  • 12:

      if New outbound mission then

            Calculate takeoff stage of the trajectory using FM2 and W

  • 14:

            Calculate the rest of the trajectory to goal point using FM2 and W

      else

  • 16:

            Calculate landing stage of the trajectory using FM2 and W

            Calculate the rest of the trajectory to depot using FM2 and W

  • 18:

      end if

      path← Composition of the complete trajectory

  • 20:

      return path

    end function