Localization & SLAM · Theory · M3
M3-T4 — Scan Matching
Estimate how the robot moved by finding the transform that makes two scans overlap.
Wheel odometry drifts. A laser scan, however, sees the same walls from the new position as from the old one, and the way those walls moved in the scan is the robot’s motion. Scan matching turns that observation into an estimator. This lesson sets up the problem, compares the main families of methods, and shows where each fails, so the ICP derivation in the next lesson has a context.
Learning objectives
After this lesson, you should be able to:
- State the scan-matching problem and its objective function.
- Distinguish scan-to-scan from scan-to-map matching and say when each is used.
- Compare point-to-point, point-to-line, NDT and correlative methods by cost and robustness.
- Diagnose failures: poor initial guess, geometric degeneracy, dynamic objects, partial overlap.
The problem and the intuition
Take two photographs of a room from slightly different positions and lay them on a light table. Slide and turn one until the furniture lines up. The amount you slid and turned is how far the camera moved. Scan matching does this with laser scans: it searches for the rigid motion that makes the second scan’s points fall on the first scan’s surfaces.
Notice the two things that can go wrong. If you start with the photographs very far out of alignment, you may line up the wrong pieces of furniture. And if the room is a long, bare corridor, you can slide the picture along it forever and it still “fits”.
Scan matching is a local search. It finds the nearest good alignment, not the best one in the world, and some scenes have no unique alignment at all.
The algorithm: choose a transform to minimise misfit
Problem. Given a reference scan (or a map) and a new scan, find the rigid transform T = (Δx, Δy, Δθ) that best aligns the new points to the reference.
Assumptions. The environment is static between scans; the two scans overlap substantially; a reasonable initial guess for T is available (usually from odometry); the scene has enough geometric structure to constrain all three degrees of freedom.
- pi
- the points of the new scan, in the sensor frame.
- T pi
- the point after transformation into the reference frame.
- dist(·, reference)
- a measure of how far a point is from the reference surface; it differs between methods.
- ρ
- a loss function; squared error is standard, robust losses (Huber, Cauchy) reduce the weight of outliers.
Families of methods
| Method | Distance used | Strength | Weakness |
|---|---|---|---|
| ICP, point-to-point (M3-T5) | Distance to the nearest reference point | Simple, no features, closed form per iteration | Needs a good initial guess; slow convergence along flat walls |
| ICP, point-to-line (or plane) | Distance to the line through nearby reference points | Faster, more accurate on walls, standard in LiDAR SLAM | Needs normals; sensitive to noisy normals |
| NDT (normal distributions transform) | Probability under a Gaussian fitted to each map cell | Smooth objective, no explicit correspondences, bigger convergence basin | Cell size choice; discontinuity at cell borders |
| Correlative scan matching | Search over a grid of poses, score by likelihood in a map | Global within the search window; very robust; runs on a GPU or in a branch-and-bound form | Cost grows with the window; limited resolution unless refined |
| Feature-based (M3-T3) | Distance between matched lines/corners | Fast; features are compact | Needs enough features; extraction errors |
Scan-to-scan versus scan-to-map
Scan-to-scan matches the new scan with the previous one: cheap and good for odometry, but each step adds a little error that accumulates (it is a kind of visual odometry for lasers). Scan-to-map matches against the map built so far (or a local submap): errors do not accumulate in the same way because the map holds the average of many scans, at the price of one more thing that must be right.
Failure modes
- Poor initial guess. The search converges to the nearest local minimum, and a rotation of more than about 15–30° or a large translation easily lands in the wrong one.
- Geometric degeneracy. In a long straight corridor every position along the corridor gives the same scan: the objective is flat in that direction, so the matcher returns whatever the initial guess said. The curvature (Hessian) of the objective has a zero eigenvalue.
- Dynamic objects. People and vehicles produce points that have no counterpart: outliers that pull the alignment unless they are rejected.
- Partial overlap. After a turn or a door, only part of the new scan has a counterpart in the old; nearest-neighbour matching pairs the rest with wrong points.
- Sparse or noisy data. Few points or rain, dust and glass distort the structure the matcher relies on.
A worked example: why a corridor cannot be matched along its length
A robot moves in a corridor with two parallel walls at y = +1 and y = −1. Its scan contains points on both walls, with normals (0, −1) and (0, +1). With point-to-line matching, the objective is a sum of squared perpendicular distances, which depend on a candidate motion (Δx, Δy, Δθ) only through the normal components.
- Each point contributes a Jacobian row [nₓ, ny, nₓ(−py) + ny px] = [0, ±1, ±px] for a wall point (px, ±1) with normal (0, ∓1). The first entry (sensitivity to Δx) is zero for every point.
- The information matrix JᵀJ therefore has a zero first row and column. Its eigenvalues are (0, λ₂, λ₃): the Δx direction has zero curvature. Any Δx gives the same objective value.
- What the matcher does. It cannot correct Δx. The result simply keeps the initial guess for that component, so the odometry’s error along the corridor passes straight through.
- A single door or pillar breaks the symmetry: points on a feature with a normal along x give non-zero entries in the first column, and Δx becomes observable. One feature is enough to restore all three degrees of freedom, provided it is in view.
- Detect it. Compute the eigenvalues of JᵀJ (or count the normals by direction) and warn when the smallest is near zero, then increase the weight of odometry or another sensor along that axis.
The lab asks you to see this directly: an ICP that works well in a room slides along a corridor.
Engineering implications and limitations
Engineering implications
- Use odometry as the initial guess and gate the result: if the match moves far from the guess, check the quality score before accepting it.
- Prefer point-to-line or NDT in structured environments and correlative matching for large search windows (loop closure, relocalisation).
- Reject outliers: trimmed matching (keep the best 80% of correspondences), distance thresholds and robust losses (Huber, Cauchy).
- Report a quality score and a covariance with every match (fraction of inliers, eigenvalues of the information matrix). The back end needs them to weight the constraint, and a degenerate match with a confident covariance is a cause of divergence.
- Use a local submap or sliding window rather than a single previous scan: more points, less noise, and fewer accumulated errors.
Limits
Scan matching measures relative motion, so its errors accumulate along a path just as odometry’s do, only more slowly. It cannot recognise a place it has seen before; that needs a global method (Module 4). It also assumes a rigid, static scene: in crowds, the match drifts toward the people it is trying to ignore.
Common misconceptions
“Scan matching finds the best alignment.”
It finds a local one. Without a good initial guess it may converge to a different, plausible but wrong alignment.
“If the matcher converges, the result is right.”
Convergence to a flat objective (corridor) or to a wrong basin also converges. Check quality and degeneracy measures.
“More points make the match better in every direction.”
More points along the same walls add no information along the corridor axis.
“Scan-to-map is always better.”
It avoids accumulation, but a map with errors biases every match; and it costs more per scan.
Engineering takeaways
- Scan matching finds the rigid transform that minimises a misfit between a new scan and a reference scan or map.
- Methods differ in the distance they use (point, line, probability) and in how large a convergence basin they have.
- The result is a local optimum: a good initial guess (odometry) matters.
- Degenerate geometry (corridors) leaves a direction unconstrained; detect it from the eigenvalues of the information matrix.
- Always reject outliers and report a quality measure with the match.
References and further reading
Established fundamentals. Learned and global registration methods are covered in Module 8.
- Besl, P. J. and McKay, N. D. (1992). A method for registration of 3-D shapes. IEEE Transactions on Pattern Analysis and Machine Intelligence 14(2).
- Biber, P. and Straßer, W. (2003). The normal distributions transform: a new approach to laser scan matching. IEEE/RSJ IROS.
- Olson, E. (2009). Real-time correlative scan matching. IEEE International Conference on Robotics and Automation.
- Zhang, J., Kaess, M. and Singh, S. (2016). On degeneracy of optimization-based state estimation problems. IEEE International Conference on Robotics and Automation.
- Pomerleau, F., Colas, F. and Siegwart, R. (2015). A review of point cloud registration algorithms for mobile robotics. Foundations and Trends in Robotics 4(1).
Knowledge check
Three conceptual questions. Write an answer, then reveal the explanation. Your answers stay in your browser.
Question 1
A robot drives through a long straight tunnel with smooth walls. Its scan matcher reports a perfect match every time, but the map shows the tunnel much shorter than it is. What happened?
Explanation
The tunnel is geometrically degenerate along its axis: every scan looks the same, so the objective has no gradient in that direction and the matcher keeps the initial guess for it, however large the real motion was. The match quality is high because the walls fit perfectly, which hides that one direction is unconstrained.
Question 2
Why is scan-to-map matching usually less prone to drift than scan-to-scan?
Explanation
Scan-to-scan estimates relative motion between consecutive scans and each small error accumulates. Scan-to-map aligns each new scan to a map that averages many earlier scans, so errors in individual scans do not compound in the same way.
Question 3
A person walks in front of the robot during a match. What happens to the estimate, and what are two ways to defend against it?
Explanation
Their points have no counterpart in the reference, and with squared error they pull the alignment toward themselves. Defences: trimmed matching or a robust loss that down-weights large residuals, and rejecting correspondences farther than a threshold; also removing dynamic points with temporal consistency.
What’s next
The next lesson derives the most widely used scan-matching algorithm, ICP, including its closed-form step and its convergence behaviour.
Related content
Nothing below is required to finish this lesson.
- BeforeM3-T3: Feature-Based Mapping
Extract lines and corners from scans as features, and compare feature, grid and landmark maps.
- LabM3-L3: Diagnose Scan-Matching Failure
ICP converges to the wrong alignment: diagnose initial guess, outliers and geometry degeneracy and repair them.
Get notified when the next lesson and new labs are released.
One email per new lesson or lab.