Segmentation Fault in LocalMapping for stereo_inertial
Hi,
I am trying to run ORB-SLAM3 (ROS version) with T265. My colleagues recorded a ROS bag including stereo images and imu topics. When we run ORB-SLAM3 in slam mode, there is always a chance that a segmentation fault occurs. We used gdb to debug this issue and found the problem may lie in LocalMapping thread (in function CreateNewMapPoints or KeyFrameCulling) since every time the error info will be something like the following:
Thread 6 "Stereo_Inertial" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffcbc63700 (LWP 5098)]
0x00007ffff7d02e35 in ORB_SLAM3::LocalMapping::CreateNewMapPoints (this=0x555555ac8160)
at /usr/include/c++/9/bits/stl_vector.h:1058
1058 operator[](size_type __n) const _GLIBCXX_NOEXCEPTThread 6 "Stereo_Inertial" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffcbc63700 (LWP 95196)]
0x00007ffff7d0510f in ORB_SLAM3::LocalMapping::KeyFrameCulling (this=0x555555ac8160)
at /usr/include/c++/9/bits/stl_vector.h:1058
1058 operator[](size_type __n) const _GLIBCXX_NOEXCEPTWe suspect that the index of some vectors in these two functions is out of bounds. Currently we commented the KeyFrameCulling() function and focus on solving the issue in CreateNewMapPoints(). We inserted cout before and after the following line:
if (i > 0 && CheckNewKeyFrames())and found this might be the reason causing this segmentation fault. However, we failed to find a solution to further debug this issue. Could anyone be so kind to provide any insight to solve this problem? Many thanks.
Any help or discussion is appreciated.
Source: UZ-SLAMLab/ORB_SLAM3