Run
Switch to 3D
Drag to pan, wheel / pinch to zoom, double-click to fit. Dragging right moves the map right.
Robot and motion noise
Sensor (range and bearing)
Layers
Live readouts
Time
Position error, EKF
Position error, dead reckoning
Robot 1σ (x,y)
Landmarks mapped
Map RMSE
tr(P) of robot block
Mean NEES (pose, dof 3)
Wrong associations
Live graphs
Position error (m): EKF (green) vs dead reckoning (orange); dashed = EKF 2σ bound.
Pose uncertainty tr(Prr) (log); drops sharply at loop closure.
Running mean NEES (should hover near 3 if the filter is consistent).
What to try
  • Pick "Noisy odometry" and watch orange dead reckoning drift away while the green estimate is pulled back by landmarks.
  • Route "rounded loop": the first time old landmarks are seen again, tr(P) collapses (loop closure).
  • "Lawnmower" never revisits: error grows slowly even with an EKF.
  • Switch association to nearest neighbour with bearing noise at 8 deg and many landmarks: wrong matches appear and the map diverges.
Self-checks
The science

State. One joint Gaussian x = [xr, yr, θ, l1x, l1y, ...] with covariance P. Robot-landmark cross terms in P are what make loop closure improve the whole map.

Prediction (unicycle). x' = x + vΔt cosθ, y' = y + vΔt sinθ, θ' = θ + ωΔt; P' = F P FT + G Q GT with F = ∂f/∂x, Q = diag(σv2, σω2). Only the robot rows and columns change.

Update. Measurement z = [√(dx²+dy²), atan2(dy,dx) - θ] + noise, innovation ν = z - h(x), S = H P HT + R, K = P HT S-1, x += Kν, P -= K S KT. New landmarks are initialised by inverting h and propagating the covariance through its Jacobians.

Association. Nearest neighbour accepts a landmark if the squared Mahalanobis distance νTS-1ν is below the chi-square 99% gate (9.21, 2 dof); beyond 16 a new landmark is created; in between the measurement is ignored.

Consistency. NEES = eT Prr-1 e for the pose error e has expectation 3 for a consistent filter.

Honest simplifications. The EKF linearises, so it is mildly over-confident (NEES slightly above 3) on tight turns; landmarks are static points with unique identities in "known" mode; there is no occupancy grid, no scan matching and no graph optimisation (modern systems use pose-graph or factor-graph smoothing). Heading is wrapped to (-π, π].