# Introduction
Just watch this video for the intuitive understanding
# The flow
# Initialization
Initialize the robot randomly N number of times - which yields you N possible places and orientation the robot can be in the sample space. These are our initial hypothesis - also our particles. So basically, N number of (x, y, orientation)
# Move (robot & particles)
Now move the robot. Along with this, also update all the hypothesis/particles above with this move. You'll have a new (x, y, orientation) for each particle.
# Sense (robot & particles)
Now after this movement, measure the robot position. For each particle, you'll be measuring distance of each particle from known landmarks (post the movement) and coming up with the probability that this particle is where the robot is, also known as measurement probability. These particle probabilities are our weights.
# Resampling (particles)
Now resample by picking one particle at random from the "particle bag" with replacement and use the weights of the particles for probability of each particle being picked up. When you repeat this N number of times, particles with lower particles filter out since they have lower probability of being picked to begin with. However, particles with higher probabilities will be picked over and over again, basically accumulating most particles in a handful of locations post resampling.
You move forward with this and go back to the move state again. and repeat the process over and over again and the particles will gradually cluster to a confident location.
Stochastic universal sampling explained below
Resampling coding explained here
# Orientation
Orientation will eventually get better over iterations.
# Error
Calculate the residual error after each particle filter iteration to see if the particles are clusterd at a given location - cause that implies the robot is sure of its location.
Implementation of simple particle filters in 2d
# Circular Motion
Radius of curvature for car steering explained here
If we create a particle filter with 1 particle only, it will get sampled regardless of the measurements. Therefore it will likely fail as it ignores the information we need to estimate the robot location
nonparametric filters, such as particle filters and histogram filters, can use parametric distributions as part of their algorithms (e.g., calculating importance weights). As noted in Probabilistic Robotics, "Nonparametric filters do not rely on a fixed functional form of the posterior, such as Gaussians. Instead, they approximate posteriors by a finite number of values." As we saw in the Mars Glider project, nonparametric filters can use parametric distributions.