# Course 5: Sensors, State Estimation & Localization (SLAM)

- HTML Page: https://roboticsconcepts.dev/courses/sensors-state-estimation-slam/
- Estimated Time: 4 hrs

## Core Focus
Show how robots fuse noisy, drifting sensor readings over time to estimate their own state and map unfamiliar environments.

## Why It Matters Today
Real sensors drop frames, drift, and blur; state estimation provides the reliable odometry, spatial grounding, and uncertainty awareness that real-world deployment demands.

## Modules
- **Module 5.1: [Robot Sensors and Noise Reality](https://roboticsconcepts.dev/courses/sensors-state-estimation-slam/robot-sensors-and-noise-reality.md)** | [Python notebook (.py)](https://roboticsconcepts.dev/downloads/notebooks/course-5/01_robot_sensors_noise_drift.py)
  Proprioceptive encoders and IMUs vs. exteroceptive LiDAR, depth cameras, and optical flow; why integrating wheel clicks or IMU acceleration alone quickly drifts off course.
- **Module 5.2: [Probabilistic Belief and Bayes Filtering](https://roboticsconcepts.dev/courses/sensors-state-estimation-slam/probabilistic-belief-and-bayes-filtering.md)** | [Python notebook (.py)](https://roboticsconcepts.dev/downloads/notebooks/course-5/02_probabilistic_belief_bayes_filter.py)
  Representing robot position as a probability distribution instead of a single point; alternating motion prediction (growing uncertainty) with sensor measurement updates (shrinking uncertainty).
- **Module 5.3: [Kalman and Extended Kalman Filters (EKF)](https://roboticsconcepts.dev/courses/sensors-state-estimation-slam/kalman-and-extended-kalman-filters.md)** | [Python notebook (.py)](https://roboticsconcepts.dev/downloads/notebooks/course-5/03_kalman_and_ekf_fusion.py)
  Fusing Gaussian estimates from wheel odometry, IMUs, and external landmarks; linearizing curved robot motion models step by step.
- **Module 5.4: [Particle Filters and Global Localization](https://roboticsconcepts.dev/courses/sensors-state-estimation-slam/particle-filters-and-global-localization.md)** | [Python notebook (.py)](https://roboticsconcepts.dev/downloads/notebooks/course-5/04_particle_filters_localization.py)
  Tracking multimodal beliefs with weighted particles to solve the kidnapped robot problem in symmetric hallways.
- **Module 5.5: [Simultaneous Localization and Mapping (SLAM)](https://roboticsconcepts.dev/courses/sensors-state-estimation-slam/simultaneous-localization-and-mapping.md)** | [Python notebook (.py)](https://roboticsconcepts.dev/downloads/notebooks/course-5/05_slam_pose_graph_loop_closure.py)
  Solving the chicken-and-egg loop of mapping a room while localizing inside it; loop closure detection and pose graph relaxation.

## Interactive Sandboxes
- **Odometry & IMU Dead Reckoning Drift Simulator** (native-canvas): Dial in small wheel-slip and IMU gyro biases and watch estimated trajectory diverge dramatically from ground truth.
- **2D Extended Kalman Filter Uncertainty Ellipse Visualizer** (marimo): Watch the 2σ covariance ellipse stretch during wheel odometry prediction and snap back into focus whenever a landmark beacon is observed.
- **Particle Filter Kidnapped Robot Floorplan Demo** (native-canvas): Drop a robot into a symmetric floorplan with a 2D LiDAR scan and watch hundreds of particles converge from uniform uncertainty to the true hallway.
