← udacity portfolio
self driving car nd · slam localization · May 2019

Particle-Filter Relocalization

Markov localization via particle filter — given a known map and noisy LIDAR observations, estimate the vehicle pose. The first time Bayes felt physical.

What it did

Given (a) a pre-built map of known landmark positions and (b) a stream of noisy LIDAR observations plus IMU/wheel-odometry, estimate where the vehicle actually is. Implementation is a 2D particle filter in C++ talking to Udacity’s term-2 simulator.

The pipeline

For each timestep:

  1. Motion update. Propagate every particle forward by the commanded (velocity, yaw_rate) plus Gaussian noise on each.
  2. Sensor update. For each particle’s hypothesized pose:
    • Transform observed landmarks from car frame → world frame.
    • Data-associate observed → nearest map landmark.
    • Compute a multivariate Gaussian likelihood across the matched pairs.
    • Assign the particle a weight ∝ likelihood.
  3. Resample. Draw N new particles from the discrete distribution defined by the weights. Particles in low-likelihood regions die; high-likelihood ones split.

After ~10 steps the cloud collapses around the true pose.

What was actually tricky

What I’d do differently with hindsight

What it taught me

Probabilistic robotics finally clicked here. Particles are not estimates of the pose; they’re samples from a posterior distribution. The filter doesn’t “find” the pose, it converges the distribution. That distinction is the difference between thinking deterministically and thinking like a roboticist.


Source archive: Shivam-Bhardwaj/relocalization_project (archived)
Writeup last touched: 2026-05-22