FastSLAM, live

A robot maps a room it has never seen and decides where to look next. The filter, the map and the exploration logic are the project's own Python modules, running in your browser.

Source on GitHub

Loading Python runtime (about 5 MB)…

Step 1 of 4. First visit only; later visits load from cache.

Preview of a finished run

What is running

Each tick, the simulator hands the filter two things: wheel-encoder speeds and a 180-beam LiDAR scan. The particle filter moves every particle with the motion model (models/motion.py), scores it by how well the scan lines up with the map so far, keeps the best one for mapping and resamples (slam/fastslam.py). The map is a log-odds occupancy grid updated along each beam (slam/occupancy.py). Frontier detection and goal choice come from explore/, and A* plus the go-to-goal controller from control/.

What is simplified

The room is the wall layout of webots_worlds/SLAM_Project.wbt, rasterised to 5 cm cells. Furniture is left out. Webots is replaced by a small 2D simulator (demo/py/sim.py) with the same robot size, wheel base and 4 m LiDAR range. The per-tick loop follows scripts/live_slam_frontier.py. One change for speed: the A* safety-margin check is answered from a precomputed obstacle dilation, which gives the same result. The demo also adds recovery the Webots loop does not have: it gives up on goals it stops making progress towards, drives towards frontiers the planner cannot score, and stops when no reachable frontier is left.

Built for University of Birmingham Intelligent Robotics by Ramy Mekhzer (SLAM core), Bassel Kenaan (exploration) and Sahib Singh (control).