SLAM Visualizer
Run the SLAM Visualizer Fullscreen
Edit the SLAM Visualizer with the p5.js editor
About This MicroSim
This visualization demonstrates SLAM (Simultaneous Localization and Mapping) - the problem of building a map while simultaneously localizing within it. SLAM solves the chicken-and-egg problem: you need a map to localize, but you need to know your location to build a map.
Embedding
You can embed this MicroSim in your website using:
1 2 | |
Features
- Robot Trajectory: Move the robot to build a path (green poses)
- Landmark Observation: Detect and track landmarks (blue triangles)
- Odometry Drift: Watch accumulated error grow without loop closure
- Loop Closure: Detect when you revisit a place (red arc)
- Graph Optimization: Correct entire trajectory with loop closure constraints
- Uncertainty Ellipses: Visualize growing and shrinking uncertainty
How to Use
- Move Robot: Click repeatedly to build a trajectory (notice drift accumulates)
- Observe Landmarks: Create landmarks to constrain the map
- Complete a Loop: Keep moving until you return near the start
- Loop Closure: Click when near a previous position to detect revisit
- Optimize: Apply graph optimization to correct the trajectory
Key Concepts
The SLAM Problem
SLAM jointly estimates: - Localization: Robot pose over time \(\mathbf{x}_R\) - Mapping: Landmark positions \(\mathbf{m}_1, \mathbf{m}_2, ..., \mathbf{m}_n\)
Drift Accumulation
Without loop closure, odometry errors accumulate: - Each motion adds noise - Uncertainty ellipses grow over time - Map becomes inconsistent
Loop Closure
When the robot recognizes a previously visited place: 1. Creates a constraint between distant poses 2. Graph optimization distributes the correction 3. Entire trajectory and map improve
Lesson Plan
Learning Objectives
- Understand the simultaneous localization and mapping problem
- Recognize how drift accumulates in dead-reckoning
- Analyze how loop closure corrects the entire trajectory
Activities
- Build Without Loop Closure: Move 10+ times without closing the loop, observe drift
- Return to Start: Navigate back to starting area, perform loop closure
- Before/After: Compare trajectory before and after optimization
- Multiple Loops: Add multiple loop closures to see cumulative improvement
Assessment Questions
- Why can't you build an accurate map with pure odometry alone?
- How does a single loop closure help correct poses far from the closure point?
- What would happen with very noisy odometry but frequent loop closures?
References
- GraphSLAM Tutorial
- ORB-SLAM
- Chapter 15: Autonomous Systems and Sensor Fusion