Skip to main content
. 2018 Nov 23;18(12):4101. doi: 10.3390/s18124101
Algorithm 1 3D-SWAP for each UAV i
Input: Pointcloud from local sensors, current position pi, goal position gi
  •    1:

    whilegi not reached do

  •    2:

     Send position pi to neighbors

  •    3:

    CODinitCOD()

  •    4:

    for all UAV j within communication range do

  •    5:

      Receive its position pj

  •    6:

      (ρj,φj,zj)transformToCylindrical(pj)

  •    7:

      CODUpdateCOD(ρj,φj,zj)

  •    8:

    end for

  •    9:

    for m=1 m=M do

  •   10:

      Extract point m from local pointcloud

  •   11:

      CODUpdateCOD(ρm,φm,zm)

  •   12:

    end for

  •   13:

    (sxy,sz)computeState(COD)

  •   14:

    dg=gipi

  •   15:

    if sxy is xy-free then

  •   16:

      vxyref=dxyg and ||vxyref||=computeRefSpeed(||dxyg||,vmax)

  •   17:

    else if sxy is rendezvous then

  •   18:

      vxyref=φa and ||vxyref||=va

  •   19:

    else if sxy is xy-blocked then

  •   20:

      vxyref=0

  •   21:

    end if

  •   22:

    if sz is z-free then

  •   23:

      vzref=±computeRefSpeed(dzg,vmax), depending on whether gi is above or below

  •   24:

    else if sz is z-blocked then

  •   25:

      vzref=0

  •   26:

    end if

  •   27:

    vref(vxyref,vzref)

  •   28:

     Send vref to velocity controller

  •   29:

    end while