View full-text article in PMC Sensors (Basel). 2020 Nov 28;20(23):6814. doi: 10.3390/s20236814 Search in PMC Search in PubMed View in NLM Catalog Add to search Copyright and License information © 2020 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/). PMC Copyright notice Algorithm 2 Improved PF-based Localization (xt−1,ut,zt,Σp). 1:Xt, X¯t=ϕ 2:xodom = Motion_model(ut,xt−1) 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