How tixiaoshan/lio-sam works
LIO-SAM is a ROS1 lidar–inertial odometry and mapping package. Its main workflow deskews lidar scans using timed point and IMU data, extracts geometric features, and uses mapping optimization to estimate poses and build a map; a separate, periodically reset IMU factor graph provides high-rate odometry. Mapping also supports GPS factors and loop closure, and the package exposes map saving. The graph reflects documented or excerpted relationships; some ROS topic links to mapping are conventional but not visible in the sampled mapping excerpt, so they are marked unverified.
Main entry points: mapOptmization.cpp Map optimization · utility.h Parameters and utilities · imageProjection.cpp Scan projection · imuPreintegration.cpp IMU preintegration
Components 13
Scan front end
- Scan projection
src/imageProjection.cpp - Feature extraction
src/featureExtraction.cpp
Pose estimation
- IMU preintegration
src/imuPreintegration.cpp
Mapping and outputs
- Map optimization
src/mapOptmization.cpp - Loop closure
src/mapOptmization.cpp - GPS factors
src/mapOptmization.cpp - Keyframe map
src/mapOptmization.cpp - Map saving
src/mapOptmization.cpp
Shared runtime
- Parameters and utilities
include/utility.h
Other components
- Lidar sensor
- IMU sensor
- GPS source
- Odometry and map consumers
Connections 17
- Lidar sensor → Scan projection: provides scans
README.md - IMU sensor → Scan projection: provides motion data
README.md - Scan projection → Feature extraction: publishes deskewed cloud
src/featureExtraction.cpp - Feature extraction → Map optimization: sends features
- IMU sensor → IMU preintegration: provides measurements
src/imuPreintegration.cpp - Map optimization → IMU preintegration: supplies lidar odometry
- GPS source → GPS factors: provides GPS fixes
README.md - Map optimization → GPS factors: adds GPS factors
README.md - Map optimization → Loop closure: runs loop closure
src/mapOptmization.cpp - Map optimization → Keyframe map: stores keyframes
src/mapOptmization.cpp - IMU preintegration → Odometry and map consumers: publishes odometry
src/imuPreintegration.cpp - Map optimization → Odometry and map consumers: publishes map outputs
- Odometry and map consumers → Map saving: requests map save
- Parameters and utilities → Scan projection: provides parameters
src/imageProjection.cpp - Parameters and utilities → Feature extraction: provides parameters
src/featureExtraction.cpp - Parameters and utilities → IMU preintegration: provides parameters
src/imuPreintegration.cpp - Parameters and utilities → Map optimization: provides parameters
src/mapOptmization.cpp