Finding the current position is generally done by reading sensors and keeping track of movements. But those sensors may not be totally accurate, and the sensor platform (robot) may not move with perfect accuracy. Each time we take a new reading from our environment, we can update our best guess about the current position and increase our certainty. Each time we move, we update the total probability by adding the old measurements to the new position less some uncertainty. There are at least two general methods:
Discreet and Multi-modal via Montecarlo / Histogram / Bucket Method: Finds the probability of each possible position being the correct one. This allows for multiple positions to have a high probability of being where we are now. However, it requires an impossible amount (exponential) of memory when the number of positions increases to a real scale.
Continuous and Uni-modal via Kalman Filter: Finds the single best guess for current location, with an score for certainty / uncertainty.
Particle Filters:Continuous multi-modal tracking which scales well and is simple to implement. It maintains a set of many vectors containing position and orientation data. Each of these represents a guess as to position. Some measurement, e.g. the distance to each of several landmarks, compared to the position guess of each particle, determines that particles likelihood of being the accurate position. Particles with a low probability of being correct are deleted, and replaced with new particles which are copies of the high probability particles, in a process called "resampling".
See also: