Phase 2 of 4 · Study weeks 5-8
Sensing, state estimation and mapping
This phase makes the second checkpoint possible: a robot that knows roughly where it is and has a map of where it has been.
Topics every week
- Week 58 h
- Lidar, IMU and camera messages
- Sensor noise models in simulation
- Timestamps and transform lookups
- Recording and replaying with
rosbag2
Hand inA bag-replay tool that reruns a drive and prints message rates and delays
- Week 68 h
- Gaussian noise and covariance
- The Kalman filter and the extended Kalman filter
- Why odometry drifts
- Writing a small filter in Python
Hand inA one-dimensional and a two-dimensional filter with plots of estimate against truth
- Week 78 h
robot_localization: fusing odometry and the IMU- Covariance settings and what they mean
- Evaluating drift on a repeatable path
Hand inA drift table: wheel odometry alone against the fused estimate over three repeats
- Week 88 h
slam_toolbox: mapping, loop closure and saving a map- Map files and the map server
- Failure cases: long corridors and symmetric rooms
Hand inCheckpoint 2, with a seeded corridor failure and your predicted against measured drift
Practice projects
- Practice 1, the toy filter (Week 6): write a Kalman filter for a robot moving along a line with a noisy position sensor. Done when: the estimate error is smaller than the raw sensor error over 1,000 steps, and a plot shows the covariance shrinking.
- Practice 2, the covariance sweep (Week 7): run the fused estimator with five settings of the IMU covariance. Done when: a table shows end-point error for each, and says which setting trusted the sensor too much or too little.
- Practice 3, the corridor (Week 8): build a world with a 20 m featureless corridor and map it. Done when: the map visibly drifts, and a second map with one change (a landmark, a different scan setting) reduces the drift by a measured amount.
- Optional, noise from a datasheet: set the simulated sensor noise from a real lidar datasheet. Done when: the sensor's stated accuracy and the simulated spread agree in a table.
GitHub repos to study
Status checked 22 Nov 2026 by shallow clone, as above.
| Repo | What to read | Week |
|---|---|---|
| ros2/rosbag2 | How bags are recorded and replayed with simulation time | 5 |
| cra-ros-pkg/robot_localization | The filter nodes and their configuration reference | 7 |
| SteveMacenski/slam_toolbox | The mapping modes and the loop-closure settings | 8 |
| ros2/geometry2 | Buffer and timeout behaviour when transforms arrive late | 5 |
Milestone checkpoint
Build the sensing and mapping stack (Checkpoint 2 above). Add the lidar and IMU, record three repeats of the 10 m square and fit the estimator. Build the drift table with wheel odometry alone and with the fused estimate. Map the world, save the map and score the overlap against the simulator's true map. Seed the corridor failure, show the drift and fix it. Hand in the drift table, the map, ADR-3 (which sensors feed the estimator and why) and ADR-4 (mapping settings and the rejected alternative).
Check yourself
Answer each question in your head first, then open it to check.
Why does wheel odometry drift, and what can and cannot fix it?
Wheel slip and small calibration errors add up with every step. An IMU improves heading, and scan matching or a map corrects position. Nothing fixes drift in odometry alone, because it has no outside reference.What does covariance mean in the estimator's settings, and what happens if it is too small?
It states how much you trust a measurement. Too small and the filter follows that sensor and ignores the others. Too large and it ignores the sensor.Why record with
rosbag2and replay with simulation time?A recording lets you reproduce a failure exactly. Replaying with simulation time keeps the original timestamps consistent so filters and transforms behave as they did.What causes a transform "extrapolation into the future" error?
A message is stamped later than the newest transform the buffer holds, from clock mismatch or delay. A small transform tolerance can help, but find the delay first.Where does
slam_toolboxtend to fail?In long featureless corridors, symmetric spaces, during fast turns and where loop closure matches the wrong place.