Particle Filter Simulation
This simulation was used as a means to test our implementation of particle filter localization on a NAO robot for a class project. We set up six beacons in the lab, and determined the robot's distance and angle from each one using vision-based blob detection. These measurements, along with known real-world positions of each beacon, were used by the particle filter to approximate the robot's position and orientation.
Move your mouse around the screen to move the robot. Click to lock the robot's position.
Number of Particles:
Animation Speed (FPS):
Random Walk Frequency:
Every 5 Frames
Random Walk Max Distance:
Robot Position: (x, y)
Click on an image to enlarge.
|The robot is displayed in the simulation as a white square, but its actual position is not known by the particle filter. That is what the particle filter is trying to estimate. In the lab, we worked with the Aldebaran NAO humanoid robot.|
|There is always a chance that none of the particles will end up near the correct location. To deal with this problem, the particle filter does a "random walk" where each particle is randomly moved some distance every few frames (the frequency and distance of the random walk can be adjusted in this simulation). Although this may cause some particles to move away from the robot's actual location, it will also cause some to move the right way. Thus, if all particles end up in the wrong place, the random walk ensures that they will not become "stuck" there. Additionally, if the robot is suddenly moved (the kidnapped robot problem) to a different place, the random walk allows the particle filter to re-discover the right location.|
|When the robot starts moving, all particles are moved by the same amount. This allows the particle filter to respond more quickly to changes in the robot's position. In this simulation, steadily moving the robot will also move the particles.|
This simulation only deals with the robot's location, and not its orientation. Once we were able to get the location part to work, adapting the filter to also handle orientation was trivial.
The script that defines the matrices and interfaces with the HTML is also available here.