This paper presents ORB-SLAM2, an open-source SLAM (Simultaneous Localization and Mapping) system designed for monocular, stereo, and RGB-D cameras. The system includes features such as map reuse, loop closing, and relocalization capabilities, enabling it to operate in a wide range of environments, from small hand-held indoor sequences to large-scale outdoor scenarios. ORB-SLAM2 uses bundle adjustment with monocular and stereo observations to achieve accurate trajectory estimation with metric scale. It also features a lightweight localization mode that leverages visual odometry and map point matches for zero-drift localization in unmapped regions. The system's performance is evaluated on 29 popular public sequences, demonstrating state-of-the-art accuracy in most cases. The source code is released to benefit the SLAM community and to serve as a versatile SLAM solution for researchers in other fields. The paper discusses related work in stereo and RGB-D SLAM, describes the system architecture, and presents detailed evaluation results, including comparisons with state-of-the-art methods.This paper presents ORB-SLAM2, an open-source SLAM (Simultaneous Localization and Mapping) system designed for monocular, stereo, and RGB-D cameras. The system includes features such as map reuse, loop closing, and relocalization capabilities, enabling it to operate in a wide range of environments, from small hand-held indoor sequences to large-scale outdoor scenarios. ORB-SLAM2 uses bundle adjustment with monocular and stereo observations to achieve accurate trajectory estimation with metric scale. It also features a lightweight localization mode that leverages visual odometry and map point matches for zero-drift localization in unmapped regions. The system's performance is evaluated on 29 popular public sequences, demonstrating state-of-the-art accuracy in most cases. The source code is released to benefit the SLAM community and to serve as a versatile SLAM solution for researchers in other fields. The paper discusses related work in stereo and RGB-D SLAM, describes the system architecture, and presents detailed evaluation results, including comparisons with state-of-the-art methods.