Q&A-1Choose mapping, localization, odometry, or SLAM for a robot product.
Answer
Assumptions first: a warehouse AMR, differential drive, 1.5 m/s, 2.5 m aisles, one 2D LiDAR at 1.8 m, wheel encoders, a MEMS IMU, and a site map built during commissioning. Pallets move daily; the building shell does not.
My answer: localization against a governed map at runtime, AMCL in Nav2, with SLAM used only during commissioning to build that map, and odometry as the motion model inside the filter, never as a standalone answer. Mapping alone is not a product mode; you would have a map and no pose to act on.
Why not odometry alone: a differential drive with decent encoders drifts roughly 1–2% of distance travelled, and a MEMS gyro adds a few degrees per minute of bias. Over a 100 m run that is 1.5 m of error. The half-aisle is 1.25 m, so the robot reaches the racking before the next correction. Odometry is the thing you integrate between LiDAR updates, not the thing you trust.
| Option | Gives you | Cost | Pick when |
|---|---|---|---|
| Odometry | pose increments at 100 Hz, no map | drifts 1–2% of distance | only inside a few metres, or as a filter input |
| Localization (AMCL) | pose in a known map, ~5 cm in a mapped aisle | needs map + LiDAR, ~10 Hz | map exists, environment mostly static |
| Mapping with trusted poses | a map, from poses you already believe | needs an accurate pose source | commissioning, or a dedicated survey robot |
| SLAM (slam_toolbox, Cartographer) | pose and map jointly, loop closure | highest compute, hardest to debug | no map, unknown or changing environment |
Nav2 AMCL defaults are worth knowing because they set your correction rate: update_min_d 0.25 m, update_min_a 0.2 rad, 500–2000 particles, likelihood_field sensor model. At 1.5 m/s you get a pose correction roughly every 0.17 s of travel.
Failure modes, with detection and cost:
- Ambiguous localization in symmetric aisles. The particle cloud collapses onto the wrong aisle. Detect it from the cluster spread and best-particle weight: if the spread exceeds ~0.5 m or the scan likelihood falls below the running median, flag it. Recover by stopping and relocalizing globally (AMCL with unknown initial pose, or driving to an AprilTag fiducial) which costs 5–20 s of driving and blocks the aisle.
- Stale map. Pallets moved. Detect it as a scan-match residual that grows in one zone while the global pose stays consistent. Recover by re-surveying that zone and bumping the map version. Without a fleet-wide map service that is a day of re-survey.
- LiDAR dropout with odometry fallback. Watchdog the scan topic rate. At 1.5 m/s and 0.5 m/s² deceleration the stopping distance is 2.25 m: longer than the 1.25 m half-aisle, so on degraded sensing you must drop to 0.5 m/s, where stopping distance is 0.25 m.
When I would choose differently: no map and an unknown environment (exploration, inspection) makes SLAM the runtime mode, not a commissioning tool. A robot that never leaves a 10 m cell, a conveyor transfer station, is fine on odometry plus one fixed fiducial, and that is cheaper than maintaining a map at all.
Curated: · Written: · Reviewed:
Log in free to save your progress and keep bookmarks and notes for a quick revision before your interview.