Skip to main content
. 2020 Oct 1;20(19):5613. doi: 10.3390/s20195613
Algorithm 1 Point-to-sphere ICP algorithm to estimate the position of the UWB tag
  • 1:

    procedurepointToSphereICP(L,R,t,δmin,max_iter)

  • 2:

        L={l1,…,lN}: anchors’ 3D positions

  • 3:

        R={r1,…,rN}: distances from the tag to the anchors

  • 4:

        t: starting estimate of the tag position, such as the last estimate or (0,0,0) the very first time

  • 5:

        δmin: smallest position update to iterate once more

  • 6:

        max_iter: maximum number of iterations to stop ICP

  • 7:

        δ←∞, num_iter← 0

  • 8:

        while (δ>δmin) and (num_iter< max_iter) do

  • 9:

            C←getClosestPoints(L,R,t)                ▹ closest points obtained from Equation (1) and (2)

  • 10:

            U←L−C                                                ▹ set of 3D translations required for each sphere

  • 11:

            mean_update ←average(U)                        ▹ average update for each axis (from closed-form

  • 12:

                                                                                    ▹ solution of the underlying least-squares problem)

  • 13:

            t←t+mean_update                                                                ▹ update the 3D position of the tag

  • 14:

            δ←norm(mean_update)                                                                ▹ L2 norm of the update vector

  • 15:

            num_iter ←num_iter+ 1

  • 16:

        end while

  • 17:

        return t                                                                ▹ return the updated 3D position of the tag

  • 18:

    end procedure