ROBOTICS /// MONTE CARLO LOCALIZATION /// PARTICLE FILTERS /// AUTONOMOUS SYSTEMS /// SLAM /// ROBOTICS ///

Particle Filters

Master Monte Carlo Localization. Learn how autonomous robots use statistical sampling to find their way in uncertain environments.

particle_filter.js
1 / 8
12345
🤖

COMMS:How does a robot know where it is? GPS fails indoors. Instead, we use a Particle Filter (Monte Carlo Localization).

Logic Nodes

COMPILE MODULES TO UNLOCK.

Phase 1: Initialize

When a robot boots up without GPS, it suffers from 'global uncertainty'. We handle this by creating thousands of particles uniformly distributed across the map.

System Verification

What is the initial weight of each particle during uniform initialization?


Robotics Hive-Mind

Share Your Algorithms

ONLINE

Built a cool localization sim? Join the community to share code, get help with ROS, and debug your path planning!

Particle Filters: Solving Robot Localization

"Knowing where you are is the prerequisite to knowing where you are going." Monte Carlo Localization (MCL) uses statistical sampling to help autonomous systems determine their precise location in complex environments.

What is a Particle Filter?

A Particle Filter (often called Monte Carlo Localization in robotics) is an algorithm used to estimate the internal state of a system given partial and noisy observations. In simpler terms: it helps a robot figure out its coordinates (x, y, and heading) on a map.

Instead of keeping track of one "best guess" like a Kalman Filter, a Particle Filter keeps track of thousands of guesses (particles). Each particle is essentially saying: "I think the robot is exactly here, facing this direction."

The Four Steps of MCL

  1. Initialization: Scatter particles uniformly across the map. The robot has no idea where it is.
  2. Prediction (Action Update): As the robot's wheels turn (odometry), move every particle the same amount. Inject Gaussian noise because wheels slip and odometry isn't perfect.
  3. Update (Measurement Update): Read sensors (LiDAR/Camera). Compare the real reading to what each particle would see from its theoretical position. Assign a weight based on similarity.
  4. Resampling: Discard particles with low weights. Multiply particles with high weights. The cloud of particles quickly converges around the robot's true location.

Particle Filter vs. Kalman Filter

Kalman Filters are highly efficient but assume linear motion and Gaussian (bell-curve) noise. They maintain a single Gaussian distribution representing the robot's pose.

Particle Filters can handle highly non-linear models and non-Gaussian noise. More importantly, they can handle the "kidnapped robot problem" where a robot is moved without its knowledge, resulting in multiple distinct hypotheses (multi-modal distributions) until sensors rule the false ones out.

AI Overviews: Common Queries

What is resampling in Monte Carlo Localization?

Resampling is the process of discarding particles with low sensor-match weights and duplicating particles with high weights. This solves the "degeneracy problem," ensuring computational power isn't wasted tracking hypotheses that are obviously incorrect. It acts like natural selection for data.

Why use Particle Filters instead of EKF (Extended Kalman Filters)?

While EKF is computationally faster, Particle Filters are preferred when the environment is highly non-linear or when the robot's initial position is completely unknown (global localization). Particle Filters can represent multi-modal probabilities (e.g., "I'm either in the kitchen or the living room"), which an EKF cannot do effectively.

Robotics Data Lexicon

Odometry
The use of data from motion sensors (like wheel encoders) to estimate change in position over time.
Gaussian Noise
Statistical noise having a probability density function equal to that of the normal distribution (bell curve). Used to model sensor/motor inaccuracy.
LiDAR
Light Detection and Ranging. A sensor that uses lasers to measure distances and create high-resolution 3D maps.
Multi-modal Distribution
A probability distribution with more than one peak. In robotics, this means the robot thinks it could be in two or more completely different places.