Skip to content

Loop Closure Correction

Loop closure correction corrects the accumulated error (drift) that arises during SLAM. It is performed in the Correction tab of the 3D Map Editor.

Screen Layout

Map correction editor full view — MapControls panel on the left and 3D viewport in the center
  • Left panel: Map load/save (MapControls), loop closure panel (LoopClosurePanel), georeference panel
  • Center: 3D viewport (point cloud + pose graph)

Keyframe Color Codes

Keyframes in the 3D viewport are color-coded:

ColorMeaning
RedTarget map keyframe (existing map)
GreenSource map keyframe (map to be merged)
CyanPinned keyframe (Prior Factor applied)

Workflow

The full flow, from selecting target/source keyframes through gizmo adjustment, ICP alignment, and optimization:

Manual loop closure — aligning poses with the gizmo after selecting target/source keyframes
  1. In the 3D viewer, Ctrl + right-click the reference keyframe, then click Set as Target (Red).

    Set as Target — open the context menu with Ctrl + right-click and choose Set as Target (Red)
  2. Ctrl + right-click the other keyframe to be corrected, then click Set as Source (Green).

    Set as Source — open the context menu with Ctrl + right-click and choose Set as Source (Green)
  3. Toggle the gizmo mode with the T / R keys, then hold Ctrl and drag the gizmo to manually adjust position and orientation.

    • T: Translate / R: Rotate
    Translate mode — switch with T and drag with Ctrl to move the keyframe position Rotate mode — switch with R and drag with Ctrl to rotate the keyframe orientation
  4. Perform fine alignment with Run ICP.

    • Noise Scale: noise value of the Between Factor (default: 0.01, range: 0 to 1)
    • Max Distance: maximum correspondence distance (default: 5.0 m, range: 0 to 10)
    Location of the Run ICP button Run ICP — precisely aligning target and source keyframes with the ICP algorithm
  5. Click Add Loop Factor (links the reference keyframe with the keyframe to be corrected).

    Add Loop Factor — add a Between Factor between the reference keyframe and the keyframe to be corrected
  6. Optimize the map with the Run Optimization button.

    Location of the Run Optimization button
    Map state before optimization

Typical Workflow

[Manual loop closure workflow]
1. Ctrl + right-click the reference keyframe → Set as Target (Red)
2. Ctrl + right-click the keyframe to be corrected → Set as Source (Green)
3. Toggle gizmo mode with T / R, then Ctrl + drag to adjust position/orientation
4. [Run ICP] → fine alignment
5. [Add Loop Factor] → link the reference and corrected keyframes
6. [Run Optimization] → optimize the map
7. Review the result and save with [Save]

Saving the Map

Corrected maps are saved in Boost serialization + Zstandard compression format (.bin.zst).

From the MapControls on the left panel:

  • Save: Saves immediately to the current path
  • Save As: Saves to a different path