ICP-SLAM
AI AI CAPTAIN. ( so pls be alert, altho I have edited a lot )
We know ICP aligns two scans. But if you just chain pairwise ICPs (
ICP-SLAM is the grown-up version. It treats the trajectory and the map as a joint optimization problem. We don't just trust the previous frame; we minimize the error across all observed frames and all points simultaneously.
1. The Problem Statement
We have:
- Poses:
frames with transforms (Base to Frame ). - Points:
landmarks, observed as (in Base frame).
If we knew the exact poses, we could just accumulate points (Mapping). If we knew the exact map, we could just locate the robot (Localization).
In SLAM, we know neither. We estimate both.
Variables to Optimize:
Poses ( ) Points ( )
Total variables:
2. The Objective Function
We minimize the Multi-View Reprojection Error*.
The residual
The total cost function (Loss) is the sum of squared residuals:
To solve this non-linear least squares problem, we use Levenberg-Marquardt (LM).
The update rule is:
But wait.
3. The Manifold: Why Addition Fails
Solution: We optimize in the *angent Space
The Maps
- Logarithmic Map (
): Group Algebra. - Takes a curved
and gives us a straight vector . (Rotation axis-angle, Translation).
- Takes a curved
- Exponential Map (
):Algebra Group. - Takes a straight vector
and maps it back to a valid rotation/translation matrix. .
- Takes a straight vector
4. The Jacobians
We linearize the residual
The update vector contains both pose perturbations and point perturbations:
The Jacobian
A. Localization Jacobian ( )
Derivative of residual w.r.t. Pose perturbation
Let
: Identity (3x3). Derivative w.r.t translation. : Negative Skew-symmetric matrix of the transformed point. Derivative w.r.t rotation. - Dimension:
.
B. Mapping Jacobian ( )
Derivative of residual w.r.t. Map Point perturbation
: The rotation matrix from Base to Frame . - Dimension:
.
We exploit this sparsity to solve the system efficiently.
5. Sparsity Structure (The Arrowhead)
The full Jacobian
- Residual
depends only on Pose and Point . - It does not care about Pose
or Point .
Structure:
- Top Left (
): Block diagonal (mostly). - Top Right (
): Block diagonal (mostly).
We exploit this sparsity to solve the system efficiently.
6. The Update Step
We solve the normal equations
Then we apply the updates. Pay attention here.
Pose Update (Manifold)
We use the exponential map to apply the 6D twist perturbation to the matrix.
(Right multiplication ensures we update in the local tangent space).
Point Update (Euclidean)
Points are just vectors. We can add them.
Summary
- Initialize: Guess poses (from Odometry/ICP) and points (from Depth).
- Compute Residuals: Error between Observation and Projection.
- Compute Jacobians:
(Poses) and (Points). - Build System: Construct
and . - Solve: Find
. - Update:
- Iterate: Until convergence (
).
This turns a drifting odometry path into a globally consistent map.