# uz-slamlab/orb_slam3 architecture

> Architecture diagram of the GitHub repository uz-slamlab/orb_slam3, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/uz-slamlab/orb_slam3
- Repository: https://github.com/uz-slamlab/orb_slam3

## Overview

ORB-SLAM3 is a real-time visual, visual-inertial, and multi-map SLAM library for monocular, stereo, and RGB-D cameras, including pinhole and fisheye models. Its documented user workflow supplies calibrated camera or dataset observations, runs SLAM, and produces a trajectory; optional ROS examples provide another input route. The graph separates tracking, map construction, and place recognition from the internal geometry and optimization layers. Several runtime connections are inferred from the product description rather than sampled caller code, so those edges are dashed and uncited.

Main entry points: [`src/Tracking.cc`](https://github.com/uz-slamlab/orb_slam3/blob/master/src/Tracking.cc) (Tracking), [`src/System.cc`](https://github.com/uz-slamlab/orb_slam3/blob/master/src/System.cc) (SLAM system), [`src/Frame.cc`](https://github.com/uz-slamlab/orb_slam3/blob/master/src/Frame.cc) (Frame processing), [`src/Optimizer.cc`](https://github.com/uz-slamlab/orb_slam3/blob/master/src/Optimizer.cc) (SLAM optimization)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["SLAM runtime"]
  node_slam["SLAM system<br/>[System.cc]"]
  node_tracking["Tracking<br/>[Tracking.cc]"]
  node_settings["Configuration<br/>[Settings.cc]"]
  node_viewer["Visualization<br/>[Viewer.cc]"]
  node_ros["ROS input"]
end

subgraph group_mapping["Mapping and recovery"]
  node_atlas[("Multi-map atlas<br/>[Atlas.cc]")]
  node_map[("Map state<br/>[Map.cc]")]
  node_landmarks["Map points<br/>[MapPoint.cc]"]
  node_keyframes["Keyframes<br/>[KeyFrame.cc]"]
  node_localmapping["Local mapping<br/>[LocalMapping.cc]"]
  node_loopclosing["Loop and merge<br/>[LoopClosing.cc]"]
  node_database[("Keyframe database")]
end

subgraph group_geometry["Vision and geometry"]
  node_frame["Frame processing<br/>[Frame.cc]"]
  node_features["ORB features<br/>[ORBextractor.cc]"]
  node_cameras["Camera models"]
  node_reconstruction["Two-view geometry"]
  node_imu["IMU preintegration<br/>[ImuTypes.cc]"]
end

subgraph group_dependencies["Core algorithms"]
  node_optimization["SLAM optimization<br/>[Optimizer.cc]"]
  node_vocabulary["ORB vocabulary<br/>[ORBVocabulary.h]"]
  node_dbow["DBoW2 vocabulary"]
  node_g2o["Graph optimizer"]
  node_sophus["Lie geometry<br/>[se3.hpp]"]
end

node_user(("Camera user"))
node_observations["Camera observations"]

node_user -->|"provides images"| node_observations
node_observations -.->|"runs SLAM"| node_slam
node_slam -.->|"dispatches tracking"| node_tracking
node_slam -.->|"configures"| node_settings
node_tracking -.->|"processes frames"| node_frame
node_frame -.->|"extracts features"| node_features
node_frame -.->|"uses projection"| node_cameras
node_tracking -.->|"initializes geometry"| node_reconstruction
node_tracking -.->|"integrates measurements"| node_imu
node_tracking -.->|"creates keyframes"| node_keyframes
node_keyframes -.->|"associates points"| node_landmarks
node_localmapping -.->|"updates map"| node_map
node_localmapping -.->|"optimizes locally"| node_optimization
node_tracking -.->|"queries relocalization"| node_database
node_loopclosing -.->|"queries candidates"| node_database
node_loopclosing -.->|"merges maps"| node_atlas
node_atlas -.->|"maintains maps"| node_map
node_optimization -->|"builds graph"| node_g2o
node_frame -.->|"computes BoW"| node_vocabulary
node_vocabulary -->|"uses vocabulary"| node_dbow
node_optimization -.->|"uses poses"| node_sophus
node_slam -.->|"provides visualization"| node_viewer
node_ros -->|"submits sensor data"| node_slam

click node_slam "https://github.com/uz-slamlab/orb_slam3/blob/master/src/System.cc"
click node_tracking "https://github.com/uz-slamlab/orb_slam3/blob/master/src/Tracking.cc"
click node_settings "https://github.com/uz-slamlab/orb_slam3/blob/master/src/Settings.cc"
click node_frame "https://github.com/uz-slamlab/orb_slam3/blob/master/src/Frame.cc"
click node_features "https://github.com/uz-slamlab/orb_slam3/blob/master/src/ORBextractor.cc"
click node_cameras "https://github.com/uz-slamlab/orb_slam3/tree/master/src/CameraModels"
click node_reconstruction "https://github.com/uz-slamlab/orb_slam3/blob/master/src/TwoViewReconstruction.cc"
click node_atlas "https://github.com/uz-slamlab/orb_slam3/blob/master/src/Atlas.cc"
click node_map "https://github.com/uz-slamlab/orb_slam3/blob/master/src/Map.cc"
click node_landmarks "https://github.com/uz-slamlab/orb_slam3/blob/master/src/MapPoint.cc"
click node_keyframes "https://github.com/uz-slamlab/orb_slam3/blob/master/src/KeyFrame.cc"
click node_localmapping "https://github.com/uz-slamlab/orb_slam3/blob/master/src/LocalMapping.cc"
click node_loopclosing "https://github.com/uz-slamlab/orb_slam3/blob/master/src/LoopClosing.cc"
click node_database "https://github.com/uz-slamlab/orb_slam3/blob/master/src/KeyFrameDatabase.cc"
click node_optimization "https://github.com/uz-slamlab/orb_slam3/blob/master/src/Optimizer.cc"
click node_vocabulary "https://github.com/uz-slamlab/orb_slam3/blob/master/include/ORBVocabulary.h"
click node_dbow "https://github.com/uz-slamlab/orb_slam3/blob/master/Thirdparty/DBoW2/DBoW2/TemplatedVocabulary.h"
click node_g2o "https://github.com/uz-slamlab/orb_slam3/blob/master/Thirdparty/g2o/g2o/core/optimizable_graph.cpp"
click node_sophus "https://github.com/uz-slamlab/orb_slam3/blob/master/Thirdparty/Sophus/sophus/se3.hpp"
click node_imu "https://github.com/uz-slamlab/orb_slam3/blob/master/src/ImuTypes.cc"
click node_viewer "https://github.com/uz-slamlab/orb_slam3/blob/master/src/Viewer.cc"
click node_ros "https://github.com/uz-slamlab/orb_slam3/blob/master/Examples_old/ROS/ORB_SLAM3/src/ros_stereo_inertial.cc"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_slam,node_tracking,node_settings,node_viewer,node_ros,node_user toneBlue
class node_atlas,node_map,node_landmarks,node_keyframes,node_localmapping,node_loopclosing,node_database toneAmber
class node_frame,node_features,node_cameras,node_reconstruction,node_imu toneMint
class node_optimization,node_vocabulary,node_dbow,node_g2o,node_sophus toneRose
class node_observations toneIndigo
```

## Components

### SLAM runtime

- [SLAM system](https://github.com/uz-slamlab/orb_slam3/blob/master/src/System.cc): `src/System.cc`
- [Tracking](https://github.com/uz-slamlab/orb_slam3/blob/master/src/Tracking.cc): `src/Tracking.cc`
- [Configuration](https://github.com/uz-slamlab/orb_slam3/blob/master/src/Settings.cc): `src/Settings.cc`
- [Visualization](https://github.com/uz-slamlab/orb_slam3/blob/master/src/Viewer.cc): `src/Viewer.cc`
- [ROS input](https://github.com/uz-slamlab/orb_slam3/blob/master/Examples_old/ROS/ORB_SLAM3/src/ros_stereo_inertial.cc): `Examples_old/ROS/ORB_SLAM3/src/ros_stereo_inertial.cc`

### Mapping and recovery

- [Multi-map atlas](https://github.com/uz-slamlab/orb_slam3/blob/master/src/Atlas.cc): `src/Atlas.cc`
- [Map state](https://github.com/uz-slamlab/orb_slam3/blob/master/src/Map.cc): `src/Map.cc`
- [Map points](https://github.com/uz-slamlab/orb_slam3/blob/master/src/MapPoint.cc): `src/MapPoint.cc`
- [Keyframes](https://github.com/uz-slamlab/orb_slam3/blob/master/src/KeyFrame.cc): `src/KeyFrame.cc`
- [Local mapping](https://github.com/uz-slamlab/orb_slam3/blob/master/src/LocalMapping.cc): `src/LocalMapping.cc`
- [Loop and merge](https://github.com/uz-slamlab/orb_slam3/blob/master/src/LoopClosing.cc): `src/LoopClosing.cc`
- [Keyframe database](https://github.com/uz-slamlab/orb_slam3/blob/master/src/KeyFrameDatabase.cc): `src/KeyFrameDatabase.cc`

### Vision and geometry

- [Frame processing](https://github.com/uz-slamlab/orb_slam3/blob/master/src/Frame.cc): `src/Frame.cc`
- [ORB features](https://github.com/uz-slamlab/orb_slam3/blob/master/src/ORBextractor.cc): `src/ORBextractor.cc`
- [Camera models](https://github.com/uz-slamlab/orb_slam3/tree/master/src/CameraModels): `src/CameraModels`
- [Two-view geometry](https://github.com/uz-slamlab/orb_slam3/blob/master/src/TwoViewReconstruction.cc): `src/TwoViewReconstruction.cc`
- [IMU preintegration](https://github.com/uz-slamlab/orb_slam3/blob/master/src/ImuTypes.cc): `src/ImuTypes.cc`

### Core algorithms

- [SLAM optimization](https://github.com/uz-slamlab/orb_slam3/blob/master/src/Optimizer.cc): `src/Optimizer.cc`
- [ORB vocabulary](https://github.com/uz-slamlab/orb_slam3/blob/master/include/ORBVocabulary.h): `include/ORBVocabulary.h`
- [DBoW2 vocabulary](https://github.com/uz-slamlab/orb_slam3/blob/master/Thirdparty/DBoW2/DBoW2/TemplatedVocabulary.h): `Thirdparty/DBoW2/DBoW2/TemplatedVocabulary.h`
- [Graph optimizer](https://github.com/uz-slamlab/orb_slam3/blob/master/Thirdparty/g2o/g2o/core/optimizable_graph.cpp): `Thirdparty/g2o/g2o/core/optimizable_graph.cpp`
- [Lie geometry](https://github.com/uz-slamlab/orb_slam3/blob/master/Thirdparty/Sophus/sophus/se3.hpp): `Thirdparty/Sophus/sophus/se3.hpp`

### Other components

- **Camera user**
- **Camera observations**

## Connections

- Camera user → Camera observations: provides images (evidence: `README.md`)
- Camera observations → SLAM system: runs SLAM
- SLAM system → Tracking: dispatches tracking
- SLAM system → Configuration: configures
- Tracking → Frame processing: processes frames
- Frame processing → ORB features: extracts features
- Frame processing → Camera models: uses projection
- Tracking → Two-view geometry: initializes geometry
- Tracking → IMU preintegration: integrates measurements
- Tracking → Keyframes: creates keyframes
- Keyframes → Map points: associates points
- Local mapping → Map state: updates map
- Local mapping → SLAM optimization: optimizes locally
- Tracking → Keyframe database: queries relocalization
- Loop and merge → Keyframe database: queries candidates
- Loop and merge → Multi-map atlas: merges maps
- Multi-map atlas → Map state: maintains maps
- SLAM optimization → Graph optimizer: builds graph (evidence: `src/Optimizer.cc`)
- Frame processing → ORB vocabulary: computes BoW
- ORB vocabulary → DBoW2 vocabulary: uses vocabulary (evidence: `include/ORBVocabulary.h`)
- SLAM optimization → Lie geometry: uses poses
- SLAM system → Visualization: provides visualization
- ROS input → SLAM system: submits sensor data (evidence: `README.md`)
