Robot localization: finding your pose in a known map
机器人定位
Treat mobile-robot localization as a Bayes filter over pose, separate position tracking, global localization and the kidnapped robot problem, compare Gaussian, grid and particle beliefs, and see Monte Carlo localization converge, get lost after a kidnapping and recover with random particles in a synthetic corridor.
localizationWhere am I on this map?
Robot localization means working out where a robot is and which way it faces. It uses a map the robot already has, its own motion records and its sensor readings. Almost every useful task, from delivering mail to guiding museum visitors, starts with knowing where the robot is. For example, a robot in a hallway can compare “I see a door 2 m ahead” with the doors on its map to narrow down its position.
The quantity to estimate is the robot’s pose: its position and its heading (the direction it faces). In a flat building this is three numbers, . Thrun and co-authors quote an earlier reference that calls localization “the most fundamental problem” for autonomous mobile robots. Problem definition
The robot has two kinds of information. Odometry, from counting wheel turns, says how far it thinks it moved. Navigating on odometry alone is called dead reckoning. Its small errors add up, so the uncertainty grows with the distance travelled. Sensors such as sonar, laser rangefinders or cameras compare the surroundings with the map. But a single reading is often ambiguous, because many places in a building look alike. Motion and sensing
The problem comes in three levels of difficulty. In position tracking the robot knows where it started and only needs to correct small odometry errors. In global localization it is not told where it started, so it must consider many places at once. In the kidnapped robot problem a robot that knows its location is carried somewhere else without being told. It may firmly believe it is still where it was, so this tests whether it can recover from a serious failure. All three get harder when people walk around and block the sensors. Three problems
This article treats localization as a Bayes filter over the pose, using the update loop derived in state estimation. It focuses on Monte Carlo localization (MCL), which is the particle filter applied to a robot’s pose. Building the map is covered in occupancy grid maps. Estimating map and pose together is SLAM, and combining GPS with inertial sensors is sensor fusion. Background: robot kinematics and the robotics overview.
Localization as a Bayes filter
This section writes localization as a Bayes filter and describes its motion and sensor models. It then compares ways to store the belief and explains MCL and its fixes.
The belief over poses
The belief is the probability distribution over the robot’s pose, given everything seen so far and the map.
In words: is the probability of each pose at step , given the sensor readings to , the odometry or control inputs to , and the map .
Dellaert and co-authors describe localization as an instance of Bayesian filtering, with the 3-D pose as the state. Bayesian filtering Each step predicts with a motion model and corrects with a sensor model.
In words: to get the new belief, first spread the old belief through the motion model . Then multiply by how likely the reading is at each pose in the map, and rescale with the constant so that everything sums to one. This follows the equations of Dellaert and co-authors and of Thrun and co-authors, with the map written explicitly. Recursion
Thrun and co-authors note that a uniform initial belief, equal probability everywhere, corresponds to global localization. Uniform initial belief Fox and co-authors point out that the update is strictly valid only if the environment is Markovian: past readings must be independent of future ones, given the true pose. They assume this and point to extensions for other cases. Markov assumption
What single pose should the robot report? Dellaert and co-authors use the most probable pose or the mean when the belief has one peak. During global localization the belief has several peaks, and then a single position estimate is not appropriate. Point estimates
The motion model
The motion model is a noisy version of the robot’s kinematics. Thrun and co-authors typically add zero-mean Gaussian noise to the translation and rotation measured by odometry. As a result the uncertainty grows with the distance travelled. MCL needs only a way to sample from this model, not a formula for its density. Motion model Fox and co-authors show a robot that uses only odometry: its cloud of samples spreads out more and more over time. Robot without sensing
The sensor model
For range finders, Thrun and co-authors first compute the expected distance at a pose by ray tracing. That means following each beam through the map until it hits an obstacle. They then model each real reading as a mix of three parts. A Gaussian covers correct readings with noise. An exponential part covers short random readings, for example from people. A narrow uniform part covers readings at the maximum range. Beam model
The probabilities of the individual beams are multiplied, which assumes the beams are independent given the pose. People blocking several beams at once can violate this assumption; Thrun and co-authors suggest that using only a subset of beams may then help. Beam independence
Our example uses a simpler, two-part mixture for a one-dimensional sensor.
In words: with probability the reading is the expected value from the map plus Gaussian noise of standard deviation . With probability it is an outlier, equally likely anywhere on a range of length . This is our simplification of Thrun and co-authors’ three-part model. The uniform part puts a floor under the likelihood, so one bad reading cannot drive a pose’s probability to zero.
Choosing how to store the belief
The representation of the belief decides which of the three problems a method can solve. Kalman-filter localization stores the belief as one Gaussian. Dellaert and co-authors call it robust and accurate for tracking, but it cannot represent ambiguities, and in its pure form it cannot relocalize globally or recover from tracking failures. Kalman localization Earlier approaches
Multi-hypothesis Kalman filters use a mixture of Gaussians and can follow several hypotheses. Thrun and co-authors note that they keep the Gaussian noise assumption, so practical systems extract features from the raw sensor data and may lose information. Multi-hypothesis tracking
Markov localization stores the belief as a piecewise-constant function. It can be topological, based on landmarks and corridor structure, or a fine metric grid. Grids can represent any shape of belief, but they cost a lot of computation and memory, and their resolution and extent must be fixed in advance. Markov localization
Monte Carlo localization
MCL stores the belief as samples (particles). Each step does three things for every particle.
In words: sample a new pose for particle from the motion model, given its old pose and the odometry . Weight it by how likely the reading is at that pose, divided by the total over all particles, then resample the set according to those weights.
Dellaert and co-authors present this as the algorithm known as the bootstrap filter, the Monte Carlo filter or the condensation algorithm, applied to localization. Fox and co-authors give the same names and call MCL a version of sampling–importance resampling (SIR). Both papers point to a resampling algorithm that runs in time. MCL algorithm MCL The resampling mechanics and their pitfalls are covered in particle filter.
The 1999 papers list several claimed advantages over earlier methods. MCL can represent beliefs with several peaks, so it can do global localization. It needs far less memory than grid-based Markov localization and can take in measurements at a higher rate. It is more accurate than a fixed-cell grid because poses are not rounded to cells, and it is easy to implement. Advantages Advantages
Dellaert and co-authors show global localization with 20,000 samples spread uniformly over the free space. After the robot enters a room, the samples gather around two positions because the corridor is symmetric, with a few scattered survivors elsewhere. The ambiguity is resolved once the room looks different to the sonars. Global localization experiment Thrun and co-authors show a similar sequence with 10,000 samples. Global localization
More samples are not always better on a real robot. With a fixed computing budget, accuracy first improves with more samples, then gets worse, because processing takes so long that measurements must be discarded. Samples and accuracy Thrun and co-authors found the best fixed size in their test at roughly 1,000 to 5,000 samples. Grid localization needed a 4 cm resolution to match, which was not feasible in real time. Samples and accuracy
Tracking needs far fewer samples than global localization. In a museum run lasting 75 minutes and covering over 2200 m, MCL with 5000 samples never lost track of the robot. Museum tracking
Adapting the number of samples
Fox and co-authors adapt the sample-set size online. They keep drawing samples until the sum of the unnormalised weights passes a threshold. If readings are surprising, as during global localization or after losing track, few samples fit well, so many are drawn. If readings are well predicted, a small set suffices. Adaptive sample-set size
Recovering from failure: two views
A finite sample set may contain no sample near the true pose, for example after a kidnapping. Resampling only copies existing samples, so plain MCL cannot get back. Fox and co-authors therefore add a small number of uniformly distributed random samples after each step. They argue this is formally allowed by sampling–importance resampling, as long as the sampling distribution is non-zero wherever the target is. They call these samples essential for relocalizing after losing track. Random samples
Thrun and co-authors, from the same group two years later, see such fixes differently. They list random samples, samples drawn from poses consistent with the latest reading, and inflated sensor noise. They call these effective but mathematically questionable, because the resulting sample set no longer approximates the correct posterior. Questionable fixes We report both views; the sources do not settle the disagreement.
Thrun and co-authors also describe a surprising failure. Basic MCL gets worse when sensors are too accurate, and fails with noise-free sensors. In their simulated object-localization task it worked best with 10–20% perceptual noise. In one failure run no sample was close enough to the true position when the object was first seen, and the final error was 394 cm. Their explanation is that a more accurate sensor gives a likelihood that is non-negligible over a smaller region, which makes this kind of miss more likely. A sensor model that overstates the noise partly helps, but it throws away information and no longer yields the posterior. Too-accurate sensors
Their remedy is Mixture-MCL. It combines two kinds of sampling. Ordinary MCL sampling guesses a pose from odometry and weights it with the sensor. “Dual” sampling guesses poses from the current reading and weights them by consistency with odometry and the previous belief. This needs a sensor model from which poses can be sampled; Thrun and co-authors learn one with kd-trees. Mixture-MCL
A corridor robot that gets kidnapped
This section runs MCL on a one-dimensional corridor and shows ambiguity, drift, global localization, a kidnapping and recovery. The program is original synthetic code, numpy only, with fixed seeds; all settings are invented toy values.
The corridor is a ring 20 m long, with doors at 1, 3, 4, 9 and 15 m. Each step the robot is commanded to move 0.5 m. Its true motion noise has a standard deviation of 0.05 m, while the filters assume 0.1 m. The sensor reports the distance to the next door ahead, with Gaussian noise of 0.3 m. With probability 0.1 it instead returns an outlier, uniform on [0, 20) m. The filters use the same mixture model. The robot truly starts at 6.2 m, which is 6.80 m after the first move. At step 50 it is teleported 7 m forward, a scripted kidnapping.
MCL uses particles and systematic resampling every step. Its estimate is the weighted circular mean on the ring. “Mass” is the posterior weight within 0.5 m of the truth. “Recovered” is our own criterion: the first step with estimate error below 0.5 m and mass above 0.5. One comparison filter is a 400-cell grid filter.
import numpy as np
# Synthetic 1-D localization on a ring corridor (length 20 m) with known door
# positions. The sensor reports the distance to the next door ahead. All numbers
# are invented toy settings; the kidnapping is a scripted teleport.
L = 20.0
DOORS = np.array([1.0, 3.0, 4.0, 9.0, 15.0])
U, MOTION_SD, SENSOR_SD, P_OUT = 0.5, 0.1, 0.3, 0.1
T, KIDNAP_AT, JUMP = 80, 50, 7.0
def wrap(x):
return np.mod(x, L)
def ring_err(a, b):
d = np.abs(wrap(a) - wrap(b))
return np.minimum(d, L - d)
def dist_ahead(x):
d = wrap(DOORS[None, :] - np.atleast_1d(x)[:, None])
return d.min(axis=1)
def likelihood(z, x):
d = dist_ahead(x)
hit = np.exp(-0.5 * ((z - d) / SENSOR_SD) ** 2) / (SENSOR_SD * np.sqrt(2 * np.pi))
return (1 - P_OUT) * hit + P_OUT / L
def world(seed):
rng = np.random.default_rng(seed)
x, xs, zs = 6.2, [], []
for k in range(1, T + 1):
x = wrap(x + U + rng.normal(0.0, 0.05))
if k == KIDNAP_AT:
x = wrap(x + JUMP)
xs.append(x)
d = dist_ahead(x)[0]
z = rng.uniform(0, L) if rng.uniform() < P_OUT else d + rng.normal(0.0, SENSOR_SD)
zs.append(z)
return np.array(xs), np.array(zs)
def systematic(w, rng):
n = len(w)
idx = np.searchsorted(np.cumsum(w), rng.uniform(0, 1.0 / n) + np.arange(n) / n)
return np.minimum(idx, n - 1)
def estimate(x, w):
ang = 2 * np.pi * x / L
return wrap(L * np.arctan2(np.sum(w * np.sin(ang)), np.sum(w * np.cos(ang))) / (2 * np.pi))
def mcl(zs, xs, n, inject, seed):
rng = np.random.default_rng(seed)
x = rng.uniform(0, L, n)
rows = []
for k in range(1, T + 1):
x = wrap(x + U + rng.normal(0.0, MOTION_SD, n))
w = likelihood(zs[k - 1], x)
w = w / w.sum()
near = float(np.sum(w[ring_err(x, xs[k - 1]) < 0.5]))
rows.append((ring_err(estimate(x, w), xs[k - 1]), near))
x = x[systematic(w, rng)]
m = rng.uniform(size=n) < inject
x[m] = rng.uniform(0, L, int(m.sum()))
return np.array(rows)
def grid(zs, xs, cells=400):
c = (np.arange(cells) + 0.5) * L / cells
b = np.full(cells, 1.0 / cells)
off = np.arange(-40, 41) * L / cells
kern = np.exp(-0.5 * ((off - U) / MOTION_SD) ** 2)
kern /= kern.sum()
rows = []
for k in range(1, T + 1):
b = sum(p * np.roll(b, s) for p, s in zip(kern, range(-40, 41)))
b = b * likelihood(zs[k - 1], c)
b /= b.sum()
rows.append(float(np.sum(b[ring_err(c, xs[k - 1]) < 0.5])))
return np.array(rows)
def recovered(rows, start):
for k in range(start, T + 1):
if rows[k - 1, 0] < 0.5 and rows[k - 1, 1] > 0.5:
return k
return None
xs, zs = world(3)
print("1) Distance-to-next-door sensor is ambiguous on its own")
z0 = dist_ahead(np.array([xs[0]]))[0]
cand = wrap(DOORS - z0)
cand = np.sort(cand[np.abs(dist_ahead(cand) - z0) < 1e-9])
print(" true x=%.2f m, noise-free reading %.2f m; every position giving that reading:" % (xs[0], z0),
np.round(cand, 2))
print("\n2) Dead reckoning from the true start (odometry only), 20 noise seeds")
errs = []
for s in range(20):
r = np.random.default_rng(1000 + s)
errs.append(np.abs(np.cumsum(r.normal(0.0, 0.05, 49))))
errs = np.array(errs)
for k in [1, 10, 25, 49]:
print(" step %2d: RMS error %.3f m" % (k, np.sqrt(np.mean(errs[:, k - 1] ** 2))))
print("\n3) Global localization then kidnapping at step %d (+%.0f m), N=1000" % (KIDNAP_AT, JUMP))
plain = mcl(zs, xs, 1000, 0.0, 7)
mixed = mcl(zs, xs, 1000, 0.05, 7)
g = grid(zs, xs)
print(" step | plain MCL err, mass<0.5m | MCL+5% random err, mass | grid mass<0.5m")
for k in [1, 2, 3, 5, 10, 20, 49, 50, 51, 55, 60, 70, 80]:
print(" %3d | %5.2f %.3f | %5.2f %.3f | %.3f"
% (k, plain[k - 1, 0], plain[k - 1, 1], mixed[k - 1, 0], mixed[k - 1, 1], g[k - 1]))
print(" first step with err<0.5 m and mass>0.5: plain %s, +random %s (before kidnap)"
% (recovered(plain, 1), recovered(mixed, 1)))
print(" recovery after kidnap: plain %s, +random %s" % (recovered(plain, KIDNAP_AT), recovered(mixed, KIDNAP_AT)))
g_rec = next((k for k in range(KIDNAP_AT, T + 1) if g[k - 1] > 0.5), None)
print(" grid filter (400 cells, never drops a cell): mass>0.5 again at step %s" % g_rec)
print("\n4) Repeat the kidnap scenario on 20 synthetic worlds (N=1000)")
for inject in [0.0, 0.01, 0.05, 0.2]:
rec, track = [], []
for s in range(20):
xs_s, zs_s = world(200 + s)
rows = mcl(zs_s, xs_s, 1000, inject, 300 + s)
r = recovered(rows, KIDNAP_AT)
rec.append(r)
track.append(np.mean(rows[29:KIDNAP_AT - 1, 0]))
ok = [r - KIDNAP_AT for r in rec if r is not None]
print(" inject %4.0f%%: recovered %2d/20, median steps %s, mean tracking err steps 30-49 %.3f m"
% (100 * inject, len(ok), int(np.median(ok)) if ok else "-", np.mean(track)))
The program prints:
1) Distance-to-next-door sensor is ambiguous on its own
true x=6.80 m, noise-free reading 2.20 m; every position giving that reading: [ 6.8 12.8 18.8]
2) Dead reckoning from the true start (odometry only), 20 noise seeds
step 1: RMS error 0.044 m
step 10: RMS error 0.148 m
step 25: RMS error 0.234 m
step 49: RMS error 0.364 m
3) Global localization then kidnapping at step 50 (+7 m), N=1000
step | plain MCL err, mass<0.5m | MCL+5% random err, mass | grid mass<0.5m
1 | 5.91 0.279 | 5.91 0.279 | 0.271
2 | 6.12 0.281 | 5.88 0.272 | 0.271
3 | 6.63 0.309 | 7.29 0.307 | 0.292
5 | 5.33 0.344 | 5.23 0.349 | 0.318
10 | 2.61 0.518 | 2.51 0.492 | 0.487
20 | 0.09 0.998 | 0.00 0.965 | 0.996
49 | 0.14 0.993 | 0.36 0.914 | 0.992
50 | 6.67 0.000 | 6.59 0.039 | 0.000
51 | 6.52 0.000 | 6.68 0.064 | 0.000
55 | 6.07 0.000 | 6.88 0.053 | 0.000
60 | 6.30 0.000 | 0.48 0.813 | 0.000
70 | 7.95 0.000 | 0.12 0.932 | 0.000
80 | 6.48 0.000 | 0.15 0.939 | 0.970
first step with err<0.5 m and mass>0.5: plain 18, +random 18 (before kidnap)
recovery after kidnap: plain None, +random 60
grid filter (400 cells, never drops a cell): mass>0.5 again at step 77
4) Repeat the kidnap scenario on 20 synthetic worlds (N=1000)
inject 0%: recovered 0/20, median steps -, mean tracking err steps 30-49 0.101 m
inject 1%: recovered 19/20, median steps 8, mean tracking err steps 30-49 0.108 m
inject 5%: recovered 20/20, median steps 7, mean tracking err steps 30-49 0.163 m
inject 20%: recovered 20/20, median steps 7, mean tracking err steps 30-49 0.517 m
Part 1 shows why one reading cannot localize. At the true position 6.80 m the noise-free reading is 2.20 m. Exactly three positions give that reading: 6.8, 12.8 and 18.8 m.
Part 2 shows dead-reckoning drift, starting from the true pose with odometry only, over 20 noise seeds. The RMS error is 0.044 m after 1 step, 0.148 m after 10, 0.234 m after 25 and 0.364 m after 49. It grows roughly like , and nothing ever shrinks it.
Part 3 follows one synthetic world. At step 1 the plain MCL estimate is 5.91 m off, with only 0.279 of the mass near the truth; the grid filter has 0.271. The belief has several peaks, so the circular mean is meaningless here, the same point Dellaert and co-authors make about point estimates. By step 20 the plain MCL error is 0.09 m and the mass 0.998; MCL with 5% random particles has error 0.00 m and mass 0.965; the grid has 0.996. Both MCL variants first meet the “recovered” criterion at step 18.
Random particles cost a little tracking quality. At step 49 plain MCL has error 0.14 m and mass 0.993, while MCL with 5% random particles has 0.36 m and 0.914.
Then comes the kidnapping at step 50. Plain MCL is 6.67 m off with mass 0.000. MCL with random particles is 6.59 m off with mass 0.039. The grid also has 0.000 near the truth. At step 60 the variant with random particles has error 0.48 m and mass 0.813, and it meets the recovery criterion there, 10 steps after the kidnap. By steps 70 and 80 its errors are 0.12 m and 0.15 m. Plain MCL is still lost at step 80 (6.48 m, mass 0.000) and never recovers within the 30 steps. Its 1000 particles stay tightly clustered at the wrong place.
The grid filter never drops a cell, thanks to the outlier floor in the sensor model, but it is slow. It regains mass above 0.5 only at step 77, 27 steps after the kidnap, and has 0.970 at step 80. The true pose starts with tiny probability, and each reading can raise it only by a bounded factor.
Part 4 repeats the kidnap scenario on 20 synthetic worlds. Without random particles, MCL recovers in 0 of 20, and its mean tracking error over steps 30 to 49 is 0.101 m. With 1% random particles per step it recovers in 19 of 20 (median 8 steps) with tracking error 0.108 m. With 5% it recovers in 20 of 20 (median 7 steps) with 0.163 m. With 20% it recovers in 20 of 20 (median 7 steps), but tracking error rises to 0.517 m. A little injection buys recovery; a lot of it degrades the estimate. Here this is partly because spread-out random particles pull the circular mean.
Where localization breaks
This section lists the assumptions that localization methods rely on and what happens when they fail.
The map must be known and right. Everything here assumes a given map. If the map is wrong or missing, the problem becomes SLAM.
The sensor model is an approximation. The beam model multiplies beam probabilities as if beams were independent, which crowds of people can break. Fox and co-authors also note that the update assumes a Markovian environment. Violations can make the filter overconfident.
Random particles are a patch, not the posterior. Injection, sensor-driven samples and inflated noise make recovery possible. Fox and co-authors argue random samples are formally allowed; Thrun and co-authors call such fixes mathematically questionable because the sample set no longer approximates the posterior. In our example, 20% injection more than quintupled the tracking error (0.101 m to 0.517 m).
Too-accurate sensors can hurt basic MCL. This is a property of the basic sampling scheme in Thrun and co-authors’ simulation, not of Bayesian filtering in general. Their noise-inflation fix changes what the filter computes.
A point estimate can mislead. With several peaks, a mean lies between them. Report the whole belief, or at least the mass near the estimate.
Success depends on definitions. Fox and co-authors counted errors over 1 m as lost, Thrun and co-authors used 2 m on their museum data, and our example uses 0.5 m plus a mass condition. Numbers measured with different definitions cannot be compared directly.
This example is a toy. It uses one invented one-dimensional map, fixed seeds and our own recovery criterion. The grid filter’s slow recovery depends on its outlier floor and motion noise. None of these numbers describe a real robot.
Exercises
These exercises cover belief representations, a likelihood calculation, a counterexample, method choice and how to read a success rate.
-
Why can a Kalman filter do position tracking but not global localization or recovery from kidnapping? What representation does each harder problem need?
Answer: A Gaussian has only one peak. Global localization needs several hypotheses at once: in the example one reading fits three positions, and Dellaert and co-authors saw two clusters from corridor symmetry. So the belief must allow several peaks, as grids, Gaussian mixtures and particles do. Kidnapping also needs probability at poses the filter is confident are wrong, or a way to create it. A grid keeps every cell but recovers slowly (step 77 in the example). Plain particles lose those poses and never recovered. Particles with random injection create new ones (Fox and co-authors; Thrun and co-authors).
-
Use the example’s sensor model: m, , m. (a) Compute for a particle whose expected reading equals , and for particles whose expected reading is off by 1.0 m and by 3.0 m. (b) What are the likelihood ratios of the matching particle to the other two? (c) Repeat (b) with .
Answer: The Gaussian peak is . (a) Match: . Off by 1.0 m: , so , plus 0.005 gives 0.009627. Off by 3.0 m: , so . (b) and . (c) With the ratios are and . The outlier floor caps how much one reading can discriminate (about 240 times), so one outlier cannot wipe out the true hypothesis. Without the floor, one bad reading can make the true pose’s weight essentially zero, the same overconfidence failure shown in state estimation.
-
A colleague says: “Our MCL has thousands of particles, all tightly clustered with high, even weights, so the pose estimate is reliable.” Construct a counterexample and name a mechanism that would catch it.
Answer: Right after the kidnapping in the example, plain MCL kept 1000 tightly clustered particles 6 to 8 m from the truth, with zero mass near it, for 30 steps. Resampling never creates poses that no particle has. A tight cluster with even weights describes the particle set, not the world. Mechanisms: random-sample injection (in the example, 1% already recovered 19 of 20 worlds), an adaptive sample size driven by how surprising the readings are (Fox and co-authors), or Mixture-MCL’s sensor-driven samples (Thrun and co-authors). Each has a cost: injection degraded tracking to 0.517 m at 20%, and Thrun and co-authors say such fixes no longer approximate the true posterior.
-
Choose a representation and justify it: (a) a warehouse robot that always starts at a charging dock with known pose and drives on a well-mapped floor; (b) a delivery robot switched on at an unknown place in an office with several identical corridors; (c) a robot that people may pick up and move; (d) a small robot on a rail with a 400-cell track.
Answer: (a) This is position tracking. A Kalman-type filter is accurate and efficient, and MCL with few samples also works, since tracking needs far fewer samples than global localization (Dellaert and co-authors). (b) This is global localization with symmetric places. Use MCL with many samples at first (20,000 in Dellaert and co-authors’ experiment) or an adaptive sample size, or a grid. The belief keeps several peaks until a distinguishing place is seen. (c) There is a kidnapping risk. Use MCL with random injection or Mixture-MCL; plain MCL failed to recover in Thrun and co-authors’ kidnap simulation and in 0 of 20 of our worlds. (d) A grid (histogram) filter is exact up to the discretisation and cheap at 400 cells, as in the state estimation example, and it never loses support. Recovery after a kidnap can still be slow (27 steps in our example), because the new pose starts with tiny probability.
-
A paper reports: “MCL localized the robot in 8 of 10 runs.” What would you ask before believing a general success rate?
Answer: Ask for the definition of success (1 m for Fox and co-authors, 2 m for Thrun and co-authors’ museum data, 0.5 m plus a mass condition in our example) and the time allowed. Ask about map symmetry, the sensor noise level (Thrun and co-authors show performance is not monotonic in sensor noise), the sample-set size, and whether real-time data dropping was modelled (Dellaert and co-authors). Ten runs give only a rough indication. Our own 20-world table is a toy result for one map and one noise setting, not a rate.
History and further reading
This section places MCL in its history and suggests where to read next. Thrun and co-authors write that most earlier localization methods addressed only position tracking. They could not recover from failures, so the robot’s position often had to be entered by hand. Approaches that solve global localization and kidnapping, they add, rely on Bayes filters with beliefs that can have several peaks. Related work
Two 1999 papers by Dellaert, Fox, Burgard and Thrun presented Monte Carlo localization; the author PDFs we read do not print their venues. They ran MCL on the robots RHINO and MINERVA, with sonar, laser and ceiling-camera data, in an office and in Smithsonian museums. Robots and experiments Experiments With vision alone, Fox and co-authors report that grid localization lost track while MCL kept several hypotheses and recovered, although its errors were sometimes above 1 m. Vision-based localization
Fox and co-authors also tested robustness by “tele-porting” the robot at random times. They turned its heading by 180 ± 90 degrees and shifted it by 200 cm, with probability 0.01 per metre travelled. Adaptive sampling beat every fixed sample size in this test. Tele-porting test
In the 2001 preprint introducing Mixture-MCL, Thrun and co-authors report that ordinary MCL failed entirely to recover after a simulated kidnapping at step 100. Adding random samples fixed this, but inefficiently, and Mixture-MCL recovered fastest. On their museum robot data, Mixture-MCL reduced the share of time the robot was lost by up to 70% compared with plain MCL. Compared with MCL using 5% random samples, the reduction was 32%. These are results on their data, not general rates. Kidnapping and museum results
For further study, read the three papers used here; the 2001 preprint also derives dual MCL in sections we did not read. Later refinements of particle-based localization are outside our sources. The particle filter article covers the sampling machinery, Kalman filter and extended Kalman filter cover Gaussian localization with landmarks, and SLAM covers the case where the map is not known.
Make a prediction, then check
A robot using Monte Carlo localization is well localized, with particles tightly clustered around the true pose. It is then carried 7 m away without being told. If each step only samples motion, weights and resamples, with no random particles added, what is most likely?
Learning objectives
- Distinguish position tracking, global localization and the kidnapped robot problem, explain which of them Gaussian, grid and particle beliefs can solve, and write localization as a Bayes filter with a motion model and a sensor model.
- Compute likelihood ratios under a mixture sensor model by hand, and explain why plain Monte Carlo localization cannot recover from a kidnapping, how random-particle injection and adaptive sample sizes help, and what each costs.
Prerequisites & connections
Explore related knowledge →References
- Robust Monte Carlo Localization for Mobile Robots — scoped
Sebastian Thrun; Dieter Fox; Wolfram Burgard; Frank Dellaert · 2001 - Monte Carlo Localization for Mobile Robots — scoped
Frank Dellaert; Dieter Fox; Wolfram Burgard; Sebastian Thrun · 1999 - Monte Carlo Localization: Efficient Position Estimation for Mobile Robots — scoped
Dieter Fox; Wolfram Burgard; Frank Dellaert; Sebastian Thrun · 1999
Version1 · Editorial status: Recorded technical checks completed
View technical check record (AI)
Claude · 2026-12-03 · Independent AI check (Claude subagent, not the author; not a human or expert review). Research was done by a separate research subagent (facts.md) and the prose by a writer subagent; style-only edits suggested by the Gemini app were applied to the opening sections before this check, and all 8 logged edits for this topic (gemini-edits-016a.json) were compared old-versus-new and kept because none changed a fact, hedge or attribution. Ran example.py with the pinned interpreter (numpy 1.26.4): output is byte-identical to example.stdout.txt, and the python block in en.mdx and zh.mdx is byte-identical to example.py; every number quoted in the prose was compared with that output. Re-derived exercise 2 (peak 1.3298, likelihoods 1.2018 / 0.009627 / ~0.005, ratios 124.8, 240.4, 258.7, ~5x10^21). Checked display equations, h2 anchors and citation IDs across languages and compared zh and en paragraph by paragraph. Re-downloaded and re-read with pdftotext: Thrun et al. 2001 preprint pp. 1-4 (definition, three problems, too-accurate sensors, fixes called mathematically questionable), pp. 9-10 (beam independence and subsampling), p. 17 (1,000-5,000 samples, 4 cm grid), pp. 18-20 (10-20% noise optimum, 394 cm failure and the authors' own explanation via the smaller support of an accurate sensor model, over-estimated noise no longer a posterior), pp. 34-35 (kidnap at step 100; 70% and 32% reductions in time lost with a 2 m criterion); Dellaert et al. 1999 pp. 1, 3 (bootstrap filter / Monte Carlo filter / condensation names, O(N) resampling citing [19]), pp. 5-6 (20,000 samples, 75 min, 2200 m, 5000 samples); Fox et al. 1999 p. 3 (SIR version, same names, O(N) resampling, random samples formally legitimate and essential), p. 6 (tele-porting test). Not re-checked line by line: Thrun §2.1-2.3 equations (garbled in extraction) and Fox's adaptive-sampling and vision sections beyond the claims quoted.
- Example rerun with the pinned interpreter matches example.stdout.txt byte for byte; both code blocks equal example.py; every quoted number matches.
- Re-derived the likelihoods and ratios of exercise 2; correct. The quiz answer is correct and prerequisite/related IDs exist in the catalogue.
- Re-downloaded and checked the relevant pages of Thrun 2001, Dellaert 1999 and Fox 1999; the random-injection disagreement is still presented as unresolved and the 70% / 32% figures stay framed as results on their data.
- zh and en match paragraph by paragraph; the Gemini style edits changed no fact or hedge.
Source locations checked:
- Robust Monte Carlo Localization for Mobile Robots — scoped · pdftotext of thrun.robust-mcl.pdf (preprint, 49 pp.; PDF page = printed page). p. 1: abstract; localization definition; 'most fundamental problem' quote of [8]; position tracking. p. 2: global localization; kidnapped robot (teleported, may firmly believe it is elsewhere, tests catastrophic-failure recovery); dynamic environments; Kalman, multi-hypothesis KF, Markov localization. p. 3: advantages (1)–(5); pitfalls (small sample sets, kidnapping, too-accurate sensors, noise-free failure). pp. 3–4: fixes (uniform samples [21], sensor-consistent samples [43], inflated noise) called mathematically questionable; Mixture-MCL idea; kd-trees. pp. 5–7 §2.1: belief, Markov assumption, uniform initial belief = global localization, recursion eq. 9, motion/perceptual model names. pp. 7–11 §2.2: Gaussian odometry noise, Figs. 1–2, sampling model; beam mixture (Gaussian, exponential, narrow uniform at max range), EM-like fitting, multiplicative integration eq. 11, people violate independence. pp. 11–13 §2.3: weighted samples, importance factors, proposal. p. 16: Fig. 6 (10,000 samples, symmetry). p. 17: best size 1,000–5,000; grid needs 4 cm. pp. 18–21: Fig. 10 (best 10–20% perceptual noise), Fig. 11 (394 cm failure; no sample close enough at first sighting; more accurate sensors give a smaller support of the perceptual model, so the miss becomes more likely — rechecked by the independent checker on p. 20), overestimated noise not a posterior. pp. 33–35 §6.1–6.2: kidnap at step 100, regular MCL fails entirely, random samples inefficient, Mixture-MCL fastest (Fig. 16, 1,000 runs); museum data: up to 70% vs plain, 32% vs 5% random samples, 2 m error criterion, 95% significance (Fig. 18). p. 40: earlier methods often needed manual position entry. NOT read: §3–§5 (dual MCL, importance factors, kd-tree learning, pp. 21–33 except skim), §7 timing beyond p. 39, conclusion, appendix.
- Monte Carlo Localization for Mobile Robots — scoped · pdftotext of the CMU RI author PDF (7 pp.). p. 1: abstract; global position estimation vs local tracking; Kalman cannot represent ambiguities or globally relocalize; grid Markov localization costs; Monte Carlo methods 'invented in the seventies' citing Handschin 1970; four advantages. p. 2: §2 localization as Bayesian filtering, state (x, y, θ), eqs. 1–2, MAP/mean only when unimodal, uniform prior for global localization; §3 Kalman, topological and grid Markov localization, sampling-based methods. p. 3: §4 MCL prediction and update phases, names (bootstrap filter, Monte Carlo filter, condensation), O(N) resampling, initialisation, §4.1 graphical example. p. 4: §4.2 importance-sampling justification, mixture predictive density with stratified sampling; robots RHINO and MINERVA. p. 5: §5.1 global localization (20,000 samples, two clusters by symmetry, scattered survivors). pp. 5–6: §5.2 accuracy vs cell size and vs number of samples, grid needs 4 cm, too many samples lose data. p. 6: §5.3 museum (75 min, over 2200 m, 5000 samples, never lost track; fewer samples for tracking; global localization under 10 s). p. 7: conclusion; sample impoverishment as future work. Venue not printed; not verified.
- Monte Carlo Localization: Efficient Position Estimation for Mobile Robots — scoped · pdftotext of fox.aaai99.pdf (7 pp.). p. 1–2: abstract, intro, advantages, adaptive sampling preview. p. 2: Markov localization (Bel(l), action model eq. 1, perception model eq. 2, Gaussian odometry errors, Markovian-environment caveat). p. 3: MCL samples ⟨x, y, θ⟩ with weights, motion and sensing steps, Fig. 1 non-sensing robot, O(N) resampling, adding a small number of uniformly distributed random samples each step (justification and re-localization rationale). p. 4: properties (1/√N rate cited from Tanner 1993, any-time), adaptive sample-set size by thresholding the sum of unnormalised weights, graphical example. p. 5: experimental setup. p. 6: vision-based localization (errors sometimes above 1 m, recovery via multiple hypotheses); adaptive-sampling experiments; tele-porting test (180 ± 90° rotation, 200 cm shift, probability 0.01 per metre; >1 m counted as lost; Fig. 10). p. 7: conclusion. Venue not printed in the PDF.
Related topics