ORB-SLAM2 code reading (1)

ORB-SLAM2 code reading (1)

Code total logic

Reference: Detailed explanation of ORB-SLAM2 (1) Introduction
ORB-SLAM is mainly divided into three threads, namely Tracking, LocalMapping and LoopClosing. The three threads are stored in the corresponding three files, Tracking.cpp, LocalMapping.cpp and LoopClosing.cpp. The overall framework of ORB-SLAM2 is as follows:
Insert picture description hereInsert picture description here
(1) Tracking (Tracking)
  This part mainly extracts ORB features from the image, performs pose estimation according to the previous frame, or initializes poses through global relocation, and then tracks the reconstructed Local map, optimize pose, and then determine new keyframes according to some rules.

(2)
  Local Mapping (LocalMapping) This part mainly completes the local map construction. This includes inserting key frames, verifying and filtering recently generated map points, then generating new map points, using local BA adjustment, and finally filtering the inserted key frames to remove redundant key frames.

(3) Closed-loop detection (LoopClosing)
  This part is mainly divided into two processes, namely closed-loop detection and closed-loop correction. Closed-loop detection first uses WOB for detection, and then calculates the similarity transformation through Sim3 algorithm. Closed-loop correction, mainly closed-loop fusion and graph optimization of Essential Graph.

stereo_kitti

Since the project requires a binocular camera to run, I mainly looked at the binocular code, starting from the stereo_kitti file (stereo: binocular; kitti: data set)
Insert picture description here

System

In the main function of the last file, we created an object SLAM of ORB_SLAM2 :: System, at this time it will enter the main interface System of the SLAM system. This code is the main entry point for all calls to the SLAM system:
Insert picture description here

Frame

The first step of the Tracking thread is to read the image and construct the Frame.

Tracking

The first thread of the system: tracking thread
Insert picture description here

Published 26 original articles · praised 0 · visits 1206

Guess you like

Origin blog.csdn.net/weixin_44264994/article/details/103977792