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

Related simulators

Continue with similar topics in this category — or all 48 in Engineering.

View category →
NewUniversity / research

EKF SLAM (toy)

Launch Simulator

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.

NewUniversity / research

ADC / DAC (Sampling)

Launch Simulator

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

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.

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.

NewSchool

Differential Drive Odometry

Launch Simulator

ω_L, ω_R → v, ω with two-wheel kinematics; integrate pose and watch dead-reckoning drift from biased wheel radii / track and noisy rate readings.

NewSchool

RRT Path Planner (grid)

Launch Simulator

Same 40×28 wall map as A*: random samples, nearest-neighbor steer, goal bias, collision-checked edges; grow an RRT and compare summary stats with one-click Manhattan A* baseline.

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/Particle Filter Localization (MCL)

Particle Filter Localization (MCL)

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.

Monte Carlo localization

360
0.22
0.14
0.48
42
ESS / N100.0%
Error (mean vs true)0.000
Resample events0

Predict: add shared odometry Δ plus Gaussian noise. Update: Gaussian range likelihood per landmark. Systematic resample when ESS is low.

Shortcuts

  • •Pause freezes motion and filter updates. Reset reinitializes particles (same seed: use the run reset button; change seed for new noise).

About this model

This page is a compact Monte Carlo localization (particle filter) sketch for a toy robot whose true trajectory is simulated for you while the filter only sees noisy range readings to fixed landmarks (orange markers) plus a noisy odometry increment each update. The motion model is deliberately simple: every filter step applies the same planar displacement the truth experienced between measurements, then adds isotropic Gaussian jitter independently to each particle so uncertainty grows under prediction. The measurement model treats each beacon range as Gaussian around the geometric distance with variance σ², so weights are proportional to a product of likelihoods (computed in log space with a max-subtraction trick for stability). When the effective sample size ESS = 1 / Σ w_i² falls below a user threshold times N, the ensemble is systematically resampled so duplicate particles do not silently starve diversity—watch the counter and the cyan cloud collapse or revive as you raise and lower σ_meas and σ_motion. A weighted mean (red ring) is shown for intuition; it is not a full Rao–Blackwellized map estimate.

Who it's for: Robotics or estimation students who have seen Bayes filters on slides and want a moving picture of predict → weight → resample before EKF or SLAM stacks.

Key terms

  • Particle filter
  • Monte Carlo localization
  • Importance sampling
  • Effective sample size
  • Systematic resampling
  • Odometry model
  • Range landmark
  • Sensor likelihood

How it works

Particle filter on a toy robot: odometry prediction and noisy range landmarks; ESS-triggered systematic resampling.

Frequently asked questions

Why does the cyan cloud sometimes “collapse” to a few locations?
After resampling, many particles share the same ancestor state—that is normal when the posterior is sharp. If σ_meas is tiny, weights become peaked quickly; increasing measurement noise or motion noise spreads mass again.
Is the red ring the same as the MAP estimate?
No—it is the posterior mean under the particle approximation. With multimodal posteriors (common early on), the mean can sit between modes; the cloud itself is the richer object.
Why give the filter the true odometry delta?
This demo factors out control-model error so you can focus on sensor geometry and resampling behavior. A production stack would propagate wheel ticks or IMU deltas with their own bias and slip models.
Does systematic resampling guarantee diversity?
It reduces variance compared with multinomial resampling but can still copy the same high-weight particle many times if the posterior is extremely peaked—jitter or roughening (not drawn here) is used in practice after resampling.