PhysSandbox
Classical MechanicsWaves & SoundElectricity & MagnetismOptics & LightGravity & OrbitsLabs
🌙Astronomy & The Sky🌡️Thermodynamics🌍Biophysics, Fluids & Geoscience📐Math Visualization🔧Engineering🧪Chemistry

Related simulators

Similar topics nearby (including related fields) — or browse all 48 in Engineering.

View category →
NewUniversity / research

Particle Filter Localization (MCL)

Launch Simulator

1D or 2D toy robot with fixed range beacons: predict with noisy odometry, update with Gaussian range likelihood, systematic resample on low ESS; weighted mean vs ground truth.

NewUniversity / research

Kalman Filter (1-D)

Launch Simulator

Recursive optimal estimation: noisy measurements, hidden truth, predict + update with Q and R; random-walk or constant-velocity model with ±2σ band and innovations.

NewUniversity / research

Holonomic 2D Hovercraft MPC (MPPI)

Launch Simulator

Planar double integrator with ‖u‖₂ thrust cap: sampling-based MPPI steers to a draggable goal while soft-penalizing circular obstacles — rollout fan and best predicted path drawn live.

NewUniversity / research

ADC / DAC (Sampling)

Launch Simulator

Sine → samples → quantization → ZOH; Nyquist and optional aliasing demo.

NewUniversity / research

Kalman Filter 2D Tracking

Launch Simulator

4-state constant-velocity tracker: noisy (x,y) measurements, process acceleration noise Q, measurement variance R, and a live ≈2σ covariance ellipse.

NewUniversity / research

MPC Pendulum Swing-Up (MPPI)

Launch Simulator

Sampling-based Model Predictive Control: K candidate torque rollouts over horizon H, MPPI cost-weighted update, bounded torque |u|≤u_max — swing up an inverted pendulum live and watch the planner replan.

PhysSandbox

Interactive physics, chemistry, and engineering simulators for students, teachers, and curious minds.

Physics

  • Classical Mechanics
  • Waves & Sound
  • Electricity & Magnetism

Science

  • Optics & Light
  • Gravity & Orbits
  • Astronomy & The Sky

More

  • Thermodynamics
  • Biophysics, Fluids & Geoscience
  • Math Visualization
  • Engineering
  • Chemistry

© 2026 PhysSandbox. Free interactive science simulators.

PrivacyTermsContact
Home/Engineering/EKF SLAM (toy)

EKF SLAM (toy)

Augmented state [x,y,θ, landmarks…]: noisy planar odometry predict, range & bearing updates with known IDs, map–robot covariance coupling; wrong map prior vs ground-truth Lissajous path.

EKF SLAM (toy)

0.18
4.5
0.06
0.04
7
Landmark map RMSE0.000m
Robot position error0.000m

State [x,y,θ,l₁ˣ,l₁ʸ,…]. Predict: noisy world-frame odometry + Q on the robot block. Update: range and bearing to each landmark (known ID); covariance P ← (I−KH)P.

Shortcuts

  • •Pause stops motion and EKF steps. Reset run reinitializes μ and P with the same wrong map prior.

About this model

This page implements a planar augmented-state EKF for a toy SLAM problem with three point landmarks whose coordinates sit in the same state vector as the robot pose (x, y, θ). A scripted ground-truth trajectory (smooth Lissajous-like motion) drives the robot while the filter receives noisy odometry increments in the world frame and range + bearing measurements to each landmark with known data association (each sensor reading is labeled with the correct landmark ID). The map is deliberately initialized wrong with a large positional covariance so you can watch the map–trajectory coupling characteristic of EKF SLAM: landmark rows of the covariance matrix become correlated with the robot as the vehicle moves and re-observes features. Updates use the standard linearized measurement Jacobian for polar observations about the current mean, a 2×2 innovation covariance with inversion in closed form, and the usual P ← (I − K H) P covariance propagation (teaching-grade numerics—symmetrized after each landmark pass). Compare the green truth robot and map with the red EKF pose and amber map estimates plus faint 2σ ellipses from the landmark marginal covariances.

Who it's for: Students who finished a Kalman filter homework and want a minimal, moving EKF SLAM picture before tackling graph-based SLAM, loop closure, or unknown correspondence.

Key terms

  • Extended Kalman filter
  • SLAM
  • Augmented state
  • Landmark
  • Range and bearing
  • Data association
  • Innovation covariance
  • Map–robot correlation

How it works

Augmented-state EKF on a planar toy: three landmarks in the state vector, noisy range & bearing updates, odometry prediction — compare EKF map and pose to ground truth.

Frequently asked questions

Why is data association “given for free” here?
Real robots must solve permutation ambiguity when landmarks look alike. Fixing IDs keeps the Jacobian dimensions small and the failure modes (permutation errors) separate from the EKF linearization story.
Why can the map drift even when measurements keep arriving?
The EKF keeps only a single Gaussian peak. Nonlinear motion and measurement models plus repeated linearization can introduce bias; inconsistent covariances (underestimated uncertainty) make drift worse. This toy exposes the coupling but does not implement loop closure or batch nonlinear refinement.
What does the amber ellipse around a landmark mean?
It is a quick 2×2 marginal visualization of the EKF covariance on that landmark’s (x, y) coordinates after projecting the full 9×9 matrix—useful for intuition, not a rigorous uncertainty polygon.
Why world-frame odometry noise instead of a bicycle model?
A planar bicycle or unicycle model is more realistic but adds bookkeeping. Shared Δx, Δy, Δθ noise keeps the motion update transparent so the lesson stays on stacked Jacobians and map updates.