Thrun et al., Chapter 6

Robot Measurements

Probabilistic sensor models: beam models, likelihood fields, and feature-based approaches.

Prerequisites: Chapters 2-5 (Bayes filter, filters, motion models).
10
Chapters
1
Simulation
10
Quizzes

Chapter 0: Why Sensor Models?

The measurement model p(zt | xt, m) answers: "If the robot is at pose xt in map m, how likely is it to see measurement zt?" This is the second ingredient of the Bayes filter, alongside the motion model.

The measurement model drives the update step: when the robot senses something, the belief is corrected by multiplying by the measurement likelihood. Good sensor models discriminate between poses — they assign high probability to poses that explain the sensor reading and low probability to poses that don't.

The fundamental question: Given a laser scan showing a wall 3.2 meters away, how probable is this reading if the robot is at position A (where the nearest wall is 3.2m away) vs. position B (where the nearest wall is 5.0m away)? The measurement model quantifies this difference and lets the Bayes filter update accordingly.

This chapter focuses on range finders (laser and sonar) because they're the most common sensors in robotics. The same probabilistic ideas apply to cameras, GPS, and other sensors.

Check: What role does the measurement model play in the Bayes filter?

Chapter 1: Maps

Sensor models require a map m to compare measurements against. Two types of maps are common:

Map TypeRepresentationExample
Location-basedGrid of occupancy valuesOccupancy grid: each cell is occupied/free
Feature-basedList of landmark positionsPoint landmarks: m = {(m1,x, m1,y), …}

Location-based maps (like occupancy grids) work naturally with beam models and likelihood fields: given the robot's pose, you can ray-cast into the grid to find expected range readings.

Feature-based maps work with feature-based sensor models: given the robot's pose, you can compute the expected range and bearing to each landmark.

Key distinction: With location-based maps, the sensor model evaluates the full range scan (180+ beams for a laser). With feature-based maps, it evaluates a small number of detected features (5-20 landmarks). Feature-based models are computationally cheaper but require reliable feature extraction.
Check: What are the two main types of maps used with sensor models?

Chapter 2: The Beam Model

The beam model is a physics-based model for range finders. It models what can go wrong when a laser beam (or sonar cone) measures distance to the nearest obstacle.

Given the robot's pose xt and a map m, we can compute the expected range ztk* for each beam k using ray casting: trace a ray from the sensor until it hits an obstacle in the map.

The actual measurement ztk may differ from ztk* for several reasons. The beam model mixes four types of errors into a single probability distribution:

p(ztk | xt, m) = zhit · phit + zshort · pshort + zmax · pmax + zrand · prand

Each component models a different type of failure. The mixing weights zhit, zshort, zmax, zrand sum to 1 and are intrinsic parameters of the sensor.

The key idea: Real sensors don't just return "correct range + Gaussian noise." They also produce unexpected short readings (people walking by), max-range readings (failures), and random noise (cross-talk). The beam model is realistic because it accounts for all four failure modes.
Check: Why is the beam model a mixture of four distributions?

Chapter 3: The Four Components

ComponentDistributionModels
phitGaussian centered at zk*Correct measurement with noise (σhit)
pshortExponential, truncated at zk*Unexpected close objects (people, furniture)
pmaxPoint mass at zmaxSensor failure (max-range reading)
prandUniform over [0, zmax]Random unexplained noise (phantom readings)

phit (Gaussian): The sensor correctly measures the nearest obstacle, plus zero-mean Gaussian noise with standard deviation σhit. This is the "normal" case. The Gaussian is truncated to [0, zmax].

pshort (Exponential): An unexpected object (a person, a chair that moved) is closer than the mapped obstacle. The probability falls off exponentially with range — closer unexpected objects are more likely to block the beam than distant ones.

pmax (Point mass): The sensor returns its maximum range. This happens when the beam misses all objects (specular reflection off smooth surfaces, black absorbing surfaces, bright ambient light). Sonar sensors are especially prone to this.

prand (Uniform): Completely unexplained readings — cross-talk between sensors, phantom reflections, electronic noise. Modeled as uniform over the full range.

Typical weights: For a laser range finder in a typical indoor environment: zhit ≈ 0.85, zshort ≈ 0.05, zmax ≈ 0.05, zrand ≈ 0.05. The dominant mode is correct measurement with noise. The other modes handle edge cases.

The mixing weights can be learned from data using EM (expectation maximization), or set by hand based on experience with the sensor.

Check: What does the pshort component model?

Chapter 4: Beam Model Demo

Explore the four components of the beam model. Adjust the mixing weights and noise parameters to see how the probability density changes for different measurements.

Beam Model Probability Density

The expected range z* is shown by the teal line. The orange curve is the mixture density p(z | x, m). Adjust weights to see each component.

zhit0.85
zshort0.05
σhit0.8
What to notice: The main peak (Gaussian) sits at z*. The exponential tail on the left captures unexpected objects. The spike at zmax captures failures. The uniform floor captures random noise. Together they produce a realistic sensor model.
Check: Where does the main Gaussian peak of phit sit?

Chapter 5: Likelihood Fields

The beam model requires ray casting for every beam at every pose — expensive! The likelihood field model is a faster alternative. Instead of tracing rays, it measures how close each beam's endpoint is to the nearest obstacle in the map.

The algorithm:

1. For each beam k, compute the endpoint (xend, yend) in global coordinates using the robot pose and beam angle.

2. Look up the distance d from (xend, yend) to the nearest obstacle in the map.

3. Evaluate a Gaussian: phit = N(d; 0, σ2). The closer the endpoint is to an obstacle, the higher the probability.

4. Mix with a uniform for random noise: p(ztk) = zhit · phit + zrand / zmax.

Key advantage: The nearest-obstacle distances can be precomputed for the entire map as a distance transform. Then evaluating the likelihood field is just a table lookup per beam — O(1) per beam instead of O(map size) for ray casting. This makes likelihood fields much faster than the beam model.
AspectBeam ModelLikelihood Field
ComputationRay casting (expensive)Table lookup (fast)
Handles max-rangeYes (explicit pmax)No (ignores max-range beams)
Handles short readingsYes (pshort)No
Common useLearning, analysisReal-time localization

The likelihood field model ignores the ray between the sensor and the endpoint — it only looks at where the beam lands. This means it doesn't model effects like people blocking the path (pshort) or max-range failures (pmax). Despite these simplifications, it works remarkably well in practice.

Check: What makes the likelihood field model faster than the beam model?

Chapter 6: Feature-Based Models

Instead of modeling raw range scans, feature-based sensor models work with extracted landmarks. A feature extractor first processes the raw scan to identify distinctive features (corners, line segments, reflective markers). Each feature is described by:

zti = (rti, φti, sti)T

where r is the range (distance to the landmark), φ is the bearing (angle), and s is the signature (feature type or identity).

Given the robot pose xt = (x, y, θ) and a landmark at (mj,x, mj,y), the expected measurement is:

r̂ = √((mj,x - x)2 + (mj,y - y)2)
φ̂ = atan2(mj,y - y, mj,x - x) - θ

The measurement likelihood is then a Gaussian centered on the expected values:

p(zti | xt, m, j) = N(zti; ẑ, Qt)
Advantage of features: Instead of evaluating 180+ beams, we evaluate 5-20 features. This is much cheaper per update. The EKF localization and EKF SLAM algorithms (Chapters 7, 10) use feature-based models because the Jacobian of the feature model is easy to compute.
Check: What does a feature-based sensor model measure for each landmark?

Chapter 7: Data Correspondences

A critical challenge with feature-based models: when the robot detects a landmark, which landmark in the map is it? This is the data association or correspondence problem.

If we know the correspondence cti = j (feature i corresponds to landmark j), evaluation is straightforward. But in practice, correspondences are unknown.

Maximum likelihood (ML) correspondence: For each detected feature, find the map landmark that maximizes the measurement probability:

ti = argmaxj p(zti | xt, m, cti = j)
Why correspondences matter: Getting the data association wrong can be catastrophic. If the robot thinks it's seeing landmark 3 but it's actually landmark 7, the belief update will push the robot's position estimate in the wrong direction. This is especially dangerous in SLAM (Chapter 10), where wrong correspondences corrupt both the pose and the map.

More sophisticated approaches maintain multiple correspondence hypotheses (multi-hypothesis tracking), or marginalize over all possible correspondences. We'll see these in the localization and SLAM chapters.

Check: What is the data association problem?

Chapter 8: Comparison

ModelInputSpeedHandles DynamicsBest For
Beam modelRaw rangesSlow (ray cast)Yes (pshort)Learning, analysis
Likelihood fieldRaw rangesFast (lookup)NoReal-time localization
Feature-basedExtracted featuresFastestNoEKF localization, SLAM
Practical guidance: Use likelihood fields for real-time particle-filter localization — they're fast and accurate enough. Use feature-based models with EKF localization or EKF SLAM — they're compact and the Jacobians are clean. Use the beam model when you need the most realistic physics or when learning sensor parameters from data.

An important practical detail: sub-sampling beams. A laser scan might have 180 beams, but adjacent beams are highly correlated. Using every 5th or 10th beam is often sufficient and much faster. The beams should be treated as approximately independent (conditionally on the pose), even though they're not perfectly so.

Check: For real-time particle filter localization, which sensor model is most commonly used?

Chapter 9: Summary

Measurement models complete the Bayes filter toolkit. Together with motion models (Chapter 5), they provide everything needed for localization and mapping.

ModelWhen to use
Beam modelPhysics-based; handles dynamic obstacles; good for learning parameters
Likelihood fieldFast real-time evaluation; precompute distance transforms; particle filter workhorse
Feature-basedCompact; clean Jacobians; EKF localization and SLAM
What comes next: With filters (Ch 2-4), motion models (Ch 5), and measurement models (Ch 6) in hand, we're ready to tackle the real problems. Chapter 7 applies everything to mobile robot localization — using the Bayes filter to determine a robot's pose from sensor data and a known map.
"A robot without a sensor model is flying blind.
A sensor model without a motion model is standing still.
Together, they see and understand."
Check: The Bayes filter needs two probabilistic models. What are they?