|
Algorithm 2: Particle filtering for localization. |
| Initialization |
|
| 1:
|
▹ Randomly initialization of particles from location p
|
| 2:
|
▹ Initialization of distribution from the position
|
| 3:
|
▹ Initialization of samples within the uncertain location |
| Recursive loop for localization |
|
| 4: while true do
|
|
| 5: k++ |
|
| 6: ENP =
|
▹ Effective number of particles |
| 7: if ENP < then
|
▹ Condition of particle population depletion () |
| 8:
|
← Resampling() |
| 9: end if
|
|
| 10: Prediction stage
|
|
| 11: ←
|
▹ Include action (dead-reckoning displacements) |
| 12: ←+·
|
▹ Include ramdom noise to the variable of interest |
| 13: Update stage
|
|
| 14: =
|
▹ Update with sensing
|
| 15: Normalization of the weights |
|
| 16: for
j← 1 to n
do
|
|
| 17: =
|
| 18: end for
|
|
| 19: end while
|
|