Skip to main content
. 2020 Nov 28;20(23):6814. doi: 10.3390/s20236814
Algorithm 2 Improved PF-based Localization (xt1,ut,zt,Σp).
  • 1:

    Xt, X¯t=ϕ

  • 2:

    xodom = Motion_model(ut,xt1)

  • 3:

    Set m as the number of particles should be sampled

  • 4:

    for i = 0 to m do

  • 5:

        xti = Sample_model(xodom,Σp)

  • 6:

        wti = Scanmach_model(zt,xti,map)

  • 7:

        Xt¯ += <xti,wti>

  • 8:

    end for

  • 9:

    for i = 0 to m do

  • 10:

        Draw xti from χt¯ with probability wti

  • 11:

        Xt += xti

  • 12:

    end for

  • 13:

    xp,t = MeanXt

  • 14:

    returnxp,t