Skip to main content
Open In Colab In the occupancy grid section, scans placed at odometry poses produced a distorted map. Estimating the poses from the measurements requires knowing which part of the map each measurement comes from. EKF localization assumed this was known: the correspondence variable ct(i)c_t(i) was given, for example by a fiducial marker ID. A laser scanner does not provide it, and neither does a camera that sees landmarks without markers: their observations carry no signature that names the landmark. A signature that does not name the landmark is still informative: an observation whose signature does not match the stored signature of a landmark is unlikely to come from that landmark, so the likelihood that scores the candidate landmarks can include a signature term, as shown below. Correspondence estimation assigns each measurement to a part of the map, or marks it as new. The filter then uses the assignment as if it were correct. When the assignment is wrong, the update moves the pose estimate in the wrong direction, and in SLAM it also moves the wrong landmark. Thrun, Burgard and Fox (2005, Section 7.6) note that a filter that keeps only the most likely correspondence tends to diverge when that correspondence is wrong. The form of the problem depends on the map:
  • Landmark maps: assign each detection to a landmark. This is data association, and it applies to any sensor that detects landmarks.
  • Point maps, as in LIDAR scan matching: pair points between two scans.
  • Image feature maps: match keypoints by appearance.

Landmark data association

Maximum likelihood correspondence

The robot has a predicted pose belief N(μˉt,Σˉt)\mathcal{N}(\bar\mu_t, \bar\Sigma_t) and a map of landmarks mkm_k. This section indexes landmarks with kk, as Table 7.3 of Probabilistic Robotics does, because each rule compares every candidate landmark. The EKF localization section writes jj for the landmark an observation came from. For an observation otio^i_t with range and bearing ztiz^i_t, and a landmark kk, the predicted measurement is z^tk=h(μˉt,k,m)\hat z^k_t = h(\bar\mu_t, k, m), as on the EKF localization page. If observation ii came from landmark kk, the innovation zti−z^tkz^i_t - \hat z^k_t is approximately Gaussian with zero mean and covariance Ψk=Htk Σˉt Htk⊤+Rt.\Psi_k = H^k_t \, \bar\Sigma_t \, H^{k\top}_t + R_t. The first term is the pose uncertainty mapped into measurement space and RtR_t is the sensor noise. The maximum likelihood correspondence is the landmark under which the measurement is most likely: c^t(i)=arg⁡max⁡k  det⁡(2πΨk)−1/2exp⁡ ⁣(−12Dik2),Dik2=(zti−z^tk)⊤Ψk−1(zti−z^tk).\hat c_t(i) = \arg\max_k \; \det(2\pi\Psi_k)^{-1/2} \exp\!\left(-\tfrac{1}{2} D^2_{ik}\right), \qquad D^2_{ik} = (z^i_t - \hat z^k_t)^\top \Psi_k^{-1} (z^i_t - \hat z^k_t). Dik2D^2_{ik} is the Mahalanobis distance. Taking −2ln⁡-2\ln of the likelihood and dropping the constant gives the equivalent rule c^t(i)=arg⁡min⁡k  (Dik2+ln⁡det⁡Ψk).\hat c_t(i) = \arg\min_k \; \left( D^2_{ik} + \ln\det\Psi_k \right). When the observations carry a signature, the likelihood under landmark kk also has an appearance factor p(κti∣κk)p(\kappa^i_t \mid \kappa_k), which scores how well the observed signature matches the one stored for landmark kk. The measurement model of EKF localization takes it as independent of the geometric error and of the pose. For a numerical signature, Thrun, Burgard and Fox make it a Gaussian, N(κti−κk; 0,σκ2)\mathcal{N}(\kappa^i_t - \kappa_k;\, 0, \sigma_\kappa^2) (Probabilistic Robotics, Table 6.4). That needs a signature you can subtract. A class label is not one, and numbering the classes would make the model depend on an arbitrary order. For the class label and appearance embedding of the office example, the label and the embedding get their own factors instead: p(κti∣κk)=P(ℓti∣ℓk)  C(τ) exp⁡ ⁣(τ eti⊤ek).p(\kappa^i_t \mid \kappa_k) = P(\ell^i_t \mid \ell_k)\; C(\tau)\, \exp\!\left(\tau\, e^{i\top}_t e_k\right). The first factor comes from the detector’s confusion matrix: the probability that it reports class ℓti\ell^i_t when the object is of class ℓk\ell_k. The second is a von Mises-Fisher density for embeddings scaled to unit length. It plays the role of a Gaussian on the unit sphere: it peaks when the two embeddings point the same way, the concentration τ\tau sets how sharply, and C(τ)C(\tau) normalizes it. The same −2ln⁡-2\ln adds one term to the score: c^t(i)=arg⁡min⁡k  (Dik2+ln⁡det⁡Ψk−2ln⁡p(κti∣κk)).\hat c_t(i) = \arg\min_k \; \left( D^2_{ik} + \ln\det\Psi_k - 2\ln p(\kappa^i_t \mid \kappa_k) \right). The appearance term does not depend on the pose, so it changes the score of each landmark without changing Ψk\Psi_k. The examples below use landmarks without signatures, so the term is absent there. In practice the appearance term is rarely a calibrated likelihood. Systems accept a match when the descriptor or embedding similarity passes a threshold, and then check it against the geometry, for example with RANSAC. Only matches that pass both checks go to the filter. Multi-object tracking uses the same structure. DeepSORT (Wojke, Bewley and Paulus, 2017) gates each detection by its Mahalanobis distance from the Kalman prediction of each track, matches the remaining pairs by the cosine distance between their CNN appearance embeddings, and updates each track’s Kalman filter with the position and size of the detected box alone. The determinant term matters because Ψk\Psi_k differs from landmark to landmark: the Jacobian HtkH^k_t depends on where the landmark is. A landmark with a large Ψk\Psi_k gets a small Mahalanobis distance for almost any measurement, and the term ln⁡det⁡Ψk\ln\det\Psi_k adds a penalty that grows with that spread. Thrun, Burgard and Fox (2005, Section 7.6.2) derive the likelihood by integrating the measurement model over the predicted belief. Each measurement is decided separately, which assumes the measurements are conditionally independent given the pose.

Gating

The minimization always returns a landmark, even when the measurement comes from an object that is not in the map. A gate rejects such measurements. For a correct correspondence, Dik2D^2_{ik} is chi-squared distributed with two degrees of freedom (range and bearing). A measurement is accepted for landmark kk only if Dik2D^2_{ik} is below the 99th percentile of χ22\chi^2_2, which is 9.21. A measurement that passes no gate is an outlier or a new landmark. EKF SLAM starts a new landmark when the distance to every landmark in the map exceeds a threshold α\alpha (Thrun, Burgard and Fox, 2005, Section 10.3.1). Spurious measurements would then create false landmarks, so practical systems keep new landmarks on a provisional list until they have been seen several times (Section 10.3.3). The code defines a map of six landmarks and the range-bearing model, and computes Dik2D^2_{ik} for four measurements.
Case 1: the predicted heading is off by 2 degrees, and the covariance reflects that. The landmarks are far apart compared to the uncertainty.
Each row has one entry below the gate, at the true landmark. The next smallest entry in any row is 29.7. All four measurements are assigned correctly. Case 2: the predicted heading is off by 15 degrees. The covariance is consistent with this error, with standard deviations of 10 degrees in heading and 0.5 m in position. Seen from the robot, landmarks 0 and 1 are about 15 degrees apart.
Two panels with six numbered landmarks, the robot's true pose and the four measurements placed from the predicted pose. With a 2 degree heading error each measurement lies on its landmark. With a 15 degree error the measurements are rotated about the robot and lines join each to its assigned landmark, with the measurement of landmark 0 assigned to landmark 1. Blue dots are the measurements placed in the world from the predicted pose. Lines join each measurement to its assigned landmark, green if correct and red if wrong. With the 15 degree error, all measurements are rotated about the robot by the same angle. The measurement of landmark 0 falls near landmark 1 and is assigned to it, so landmark 1 gets two measurements. The larger covariance also lowers every distance. For the first measurement both landmark 0 (1.4) and landmark 1 (0.7) pass the gate, so the gate does not reject the wrong assignment. The six values of ln⁡det⁡Ψk\ln\det\Psi_k lie between −4.7-4.7 and −4.5-4.5, so the determinant term barely changes the scores, and maximizing the likelihood also selects landmark 1.

Joint compatibility

The measurements share one pose error. A heading error rotates all of them by the same angle, so a set of assignments is plausible only if one pose explains all of it. The joint compatibility test checks this. For a hypothesis that pairs measurements i1,…,ini_1, \ldots, i_n with landmarks k1,…,knk_1, \ldots, k_n, stack the innovations and Jacobians: ν=[zti1−z^tk1⋮ztin−z^tkn],H=[Htk1⋮Htkn],S=HΣˉtH⊤+diag⁡(Rt,…,Rt).\nu = \begin{bmatrix} z^{i_1}_t - \hat z^{k_1}_t \\ \vdots \\ z^{i_n}_t - \hat z^{k_n}_t \end{bmatrix}, \qquad H = \begin{bmatrix} H^{k_1}_t \\ \vdots \\ H^{k_n}_t \end{bmatrix}, \qquad S = H \bar\Sigma_t H^\top + \operatorname{diag}(R_t, \ldots, R_t). The off-diagonal blocks of HΣˉtH⊤H \bar\Sigma_t H^\top couple the measurements through the shared pose. The hypothesis is jointly compatible if ν⊤S−1ν\nu^\top S^{-1} \nu is below the χ2\chi^2 threshold for 2n2n degrees of freedom. Neira and Tardós (2001) find the largest jointly compatible hypothesis with joint compatibility branch and bound (JCBB). With four measurements, the code enumerates all hypotheses instead. A measurement may stay unassigned, and no landmark is paired with more than one measurement. That second rule is the mutual exclusion principle (Thrun, Burgard and Fox, 2005, Section 7.8). The code keeps the jointly compatible hypothesis with the most pairings and breaks ties by the smaller joint distance.
Joint compatibility assigns all four measurements correctly, with a joint distance of 6.9 against a threshold of 20.1 for 8 degrees of freedom. The individual assignment uses landmark 1 twice and is not a valid hypothesis. Enumeration grows as (K+1)n(K+1)^n for nn measurements and KK landmarks; JCBB prunes this search.

Scan registration with ICP

A LIDAR map can also be a set of raw points. The motion between two scans is then estimated by aligning them, which again needs correspondences: which point in one scan is the same surface point as a given point in the other. The iterative closest point algorithm (ICP) of Besl and McKay (1992) guesses them from the current alignment, pairing each point with its nearest neighbor in the other scan. It fits the rigid transform to the guessed pairs and repeats. When the starting estimate is good, most nearest neighbors are correct pairs and the alignment improves. When the starting estimate is poor, ICP can converge to a wrong alignment. The scan registration section builds ICP step by step.

LIDAR features and loop closure

LOAM (Zhang and Singh, 2014) does not pair every point. It selects points on sharp edges and points on flat surfaces, using the curvature of the scan line around each point, and matches edge points to edge lines and surface points to planar patches in the map. The features are defined by local geometry. Loop closure needs a correspondence between whole places. A robot that returns to a mapped area has to recognize it so that the loop in the map can be closed. Scan Context (Kim and Kim, 2018) summarizes a LIDAR scan in a descriptor that is compared with stored scans. PointNetVLAD (Uy and Lee, 2018) computes such a descriptor from the point cloud with a neural network. A false loop closure merges two different places and can distort the whole map. Landmark data association also applies to LIDAR. The Victoria Park dataset of Guivant and Nebot (2001), recorded from a vehicle in a park in Sydney, uses tree trunks detected in laser scans as landmarks. It is widely used to compare landmark-based SLAM algorithms.

Image feature matching

A detector finds keypoints, such as corners, that are likely to be detected again from another viewpoint. A descriptor encodes the image patch around each keypoint as a vector. Keypoints in two images are matched by descriptor distance, and the matches are checked with a geometric model, for example with RANSAC as in the homographies section. The descriptor has the role of the signature κ\kappa in the landmark model, where a landmark observation is (r,ϕ,κ)(r, \phi, \kappa). Distinct signatures make landmarks easier to tell apart. Torralba, Isola and Freeman (2024, Section 44.3.3) cover hand-designed detectors and descriptors such as SIFT and ORB, and learned ones such as SuperPoint with the SuperGlue matcher. LightGlue (Lindenberger, Sarlin and Pollefeys, 2023) is a faster learned matcher in the same line. Place recognition compares whole images with one global descriptor per image, such as NetVLAD (Arandjelović et al., 2015) or the features of the DINOv2 foundation model (Oquab et al., 2023), which AnyLoc (Keetha et al., 2023) uses for place recognition across indoor, outdoor and aerial images. The stereo vision section uses matching for depth.

References


Found an error on this page? Report an issue.