Introduction to Particle Filter
Introduction to Particle Filter
1. circle_points=0, square_points=0
2. While #iterations not reached
i. Generate random point x between 0 and 1.
ii. Generate random point y between 0 and 1.
iii. Calculate d = x*x + y*y.
iv. If d <= 1, then increment circle_points
v. Increment square_points.
3. End while
9. Calculate pi = 4*(circle_points/square_points).
10. Terminate.
Convergence
The robot localization problem
The process of determining where a
mobile robot is located with respect to
its environment
Robot sensors
Sonar
To perform localization, the
robot relies on:
1. Its sensor information about
its current state
2. An implicit map of the
environment
3. The context. How the robot
reach here
• PF algorithm is iterative and
time dependent
𝑺𝒕−𝟏 𝑺𝒕
# 𝑝𝑎𝑟𝑡𝑖𝑐𝑙𝑒𝑠 = 𝑛 # 𝑝𝑎𝑟𝑡𝑖𝑐𝑙𝑒𝑠 = 𝑛
Sum of particle weights 𝜼 = 1 Sum of particle weights 𝜼 = 1
Particle Filter Algorithm
2
update the particle
position 𝑝𝑥 ∝ 𝑢𝑡
𝑺𝒕−𝟏 𝑺𝒕
# 𝑝𝑎𝑟𝑡𝑖𝑐𝑙𝑒𝑠 = 𝑛 # 𝑝𝑎𝑟𝑡𝑖𝑐𝑙𝑒𝑠 = 𝑛
Sum of particle weights 𝜼 = 1 Sum of particle weights 𝜼 = 1
Particle Filter Algorithm
3
update the particle
weight 𝑝𝑤 ∝ 𝑧𝑡
𝑺𝒕−𝟏 𝑺𝒕
# 𝑝𝑎𝑟𝑡𝑖𝑐𝑙𝑒𝑠 = 𝑛 # 𝑝𝑎𝑟𝑡𝑖𝑐𝑙𝑒𝑠 = 𝑛
Sum of particle weights = 1 Sum of particle weights = 1
Particle Filter Algorithm
4
Add the particle p
to 𝑺𝒕
𝑺𝒕−𝟏 𝑺𝒕
# 𝑝𝑎𝑟𝑡𝑖𝑐𝑙𝑒𝑠 = 𝑛 # 𝑝𝑎𝑟𝑡𝑖𝑐𝑙𝑒𝑠 = 𝑛
Sum of particle weights = 1 Sum of particle weights = 1
Particle Filter Algorithm
5
U𝑝𝑑𝑎𝑡𝑒 𝜼
𝑺𝒕−𝟏 𝑺𝒕
# 𝑝𝑎𝑟𝑡𝑖𝑐𝑙𝑒𝑠 = 𝑛 # 𝑝𝑎𝑟𝑡𝑖𝑐𝑙𝑒𝑠 = 𝑛
Sum of particle weights = 1 Sum of particle weights = 1
Particle Filter Algorithm
# 𝑝𝑎𝑟𝑡𝑖𝑐𝑙𝑒𝑠 = 𝑛 # 𝑝𝑎𝑟𝑡𝑖𝑐𝑙𝑒𝑠 = 𝑛
Sum of particle weights = 1 Sum of particle weights = 1
Rolette wheel sampling
• Assume the following chart represents the weights of 5 particles
in 𝑺𝒕−𝟏
• Since the sampling is proportional to the weight we may have:
𝑺𝒕 = {𝒑𝟓, 𝒑𝟒, 𝒑𝟑, 𝒑𝟓, 𝒑𝟒}
Rolette wheel sampling
• Assume the following chart represents the weights of 5 particles
in 𝑺𝒕−𝟏
• Since the sampling is proportional to the weight we may have:
𝑺𝒕 = {𝒑𝟓, 𝒑𝟒, 𝒑𝟑, 𝒑𝟓, 𝒑𝟒}
p1 p4
p4
p2
p3 p3
p5 p5