V-SLAM: The Architecture
To build a SLAM system that doesn't drift into infinity after 10 meters, we must separate the concerns into a Frontend (Fast, Local) and a Backend (Slow, Global).
1. The Frontend: Visual Odometry
The goal here is speed. We need to track the robot's motion relative to the immediate previous state.
- Scan-to-Scan: Align Frame
to Frame . - Pros: Fast.
- Cons: Drifts instantly.
error accumulation.
- Scan-to-Local-Map (The Standard): Align Frame
to a local map created by frames . - Pros: More stable constraints.
- Cons: Requires managing a local point cloud (voxel grid or k-d tree).
The Heuristic:
Don't process every frame. If the robot hasn't moved, don't update the map.
Define Keyframes:
2. The Backend: Global Optimization
The goal here is consistency. We accept that the frontend drifts. The backend's job is to "snap" the trajectory back when we recognize a place we've been before.
This is modeled as a Factor Graph (or Pose Graph).
- Nodes: The Keyframe poses.
- Edges: The constraints.
- Odometry Edges: "I moved
meters forward from Node A to Node B" (From Frontend). - Loop Closure Edges: "Node A looks exactly like Node Z" (From Place Recognition).
- Odometry Edges: "I moved
3. Loop Closure Detection
How do we know Node 1000 is the same place as Node 50?
- Geometric check:Is
? (Only works if drift is low). - Appearance check:Use descriptors (FPFH, BoW, NetVLAD).
- Verification:Run ICP between Scan 1000 and Scan 50. If fitness > threshold, add a constraint edge.
4. The Algorithm Loop
- Receive Scan
. - Predict Pose
using constant velocity model. - Frontend: ICP align
to starting at . Get . - Keyframe Check: Did we move enough?
- No: Update current pose, wait for next scan.
- Yes:
- Add Node
to Pose Graph. - Add Odometry Edge from
. - Loop Detection: Search for old nodes near
. - If match found: Add Loop Edge.
- Trigger Optimizer: Solve Graph-SLAM ( Pose Graph Optimization ).
- Update Global Map.
- Add Node