ORB_SLAM3 icon indicating copy to clipboard operation
ORB_SLAM3 copied to clipboard

segmentation fault: examples: rgbd_tum?

Open jcyhcs opened this issue 3 years ago • 15 comments

hi,professor: i test examples/rgbd: command line: ./rgbd_tum ../../Vocabulary/ORBvoc.txt TUM1.yaml rgbd_dataset_freiburg1_xyz associations/fr1_xyz.txt then run, everything seems ok, snapshot: image but, when the program ending, it print some error: First KF:0; Map init KF:0 New Map created with 837 points Starting the Viewer Shutdown

median tracking time: 0.0636379 mean tracking time: 0.064307

Saving camera trajectory to CameraTrajectory.txt ...

Saving keyframe trajectory to KeyFrameTrajectory.txt ... Segmentation fault (core dumped)

some weird , is there any bug? oh,please help

jcyhcs avatar Dec 29 '21 09:12 jcyhcs

I have also met the same problem, may I ask have you solved it?

cuixuyang615 avatar Dec 30 '21 07:12 cuixuyang615

I encounter this problem,have anyone solved?

sandstorm666 avatar Mar 23 '22 01:03 sandstorm666

I solved by uncommented some code. LocalMapper is not finished.

sandstorm666 avatar Mar 23 '22 07:03 sandstorm666

if(mpViewer)
{
    mpViewer->RequestFinish();
    while(!mpViewer->isFinished())
        usleep(5000);
}

//Wait until all thread have effectively stopped
while(!mpLocalMapper->isFinished() || !mpLoopCloser->isFinished() || mpLoopCloser->isRunningGBA())
{
    if(!mpLocalMapper->isFinished())
        cout << "mpLocalMapper is not finished" << endl;
    if(!mpLoopCloser->isFinished())
        cout << "mpLoopCloser is not finished" << endl;
    if(mpLoopCloser->isRunningGBA()){
        cout << "mpLoopCloser is running GBA" << endl;
        cout << "break anyway..." << endl;
        break;
    }
    usleep(5000);
}

these code is needed in System::Shutdown().

sandstorm666 avatar Mar 23 '22 07:03 sandstorm666

if(mpViewer)
{
    mpViewer->RequestFinish();
    while(!mpViewer->isFinished())
        usleep(5000);
}

//Wait until all thread have effectively stopped
while(!mpLocalMapper->isFinished() || !mpLoopCloser->isFinished() || mpLoopCloser->isRunningGBA())
{
    if(!mpLocalMapper->isFinished())
        cout << "mpLocalMapper is not finished" << endl;
    if(!mpLoopCloser->isFinished())
        cout << "mpLoopCloser is not finished" << endl;
    if(mpLoopCloser->isRunningGBA()){
        cout << "mpLoopCloser is running GBA" << endl;
        cout << "break anyway..." << endl;
        break;
    }
    usleep(5000);
}

these code is needed in System::Shutdown(). Hello @sandstorm666 , I appreciate your answer, and it helps me to fix the segfault bug.

nickxiang0306 avatar Jul 15 '22 06:07 nickxiang0306

does not seem to work. I uncommented it but there is still a segmentation fault

JonathanLehner avatar Feb 19 '23 15:02 JonathanLehner

does not seem to work. I uncommented it but there is still a segmentation fault

maybe u need to rebuild it

SJTUlibochen avatar Mar 02 '23 16:03 SJTUlibochen

Hi I am facing the same issue. I have tried uncommenting the above section of the code and rebuilding but I still end up with a Segmentation Fault. Any other suggestions?

IndShiv avatar May 02 '23 11:05 IndShiv

Well I found that at the end of System::Shutdown() there is if(mpViewer) pangolin::BindToContext("ORB-SLAM2: Map Viewer"); I have solved the segmentation fault by changing ORB-SLAM2 to ORB-SLAM3. Hope this could help.

yutongwangBIT avatar Sep 14 '23 08:09 yutongwangBIT

Well I found that at the end of System::Shutdown() there is if(mpViewer) pangolin::BindToContext("ORB-SLAM2: Map Viewer"); I have solved the segmentation fault by changing ORB-SLAM2 to ORB-SLAM3. Hope this could help.

That‘s worked, after uncommenting the above section of the code, and modifing " if(mpViewer) pangolin::BindToContext("ORB-SLAM2: Map Viewer"); " to " if(mpViewer) pangolin::BindToContext("ORB-SLAM3: Map Viewer"); " , you can get the result: "There are 1 maps in the atlas Map 0 has 256 KFs End of saving trajectory to f_dataset-MH01_mono.txt ... Saving keyframe trajectory to kf_dataset-MH01_mono.txt ... (base) guo@M6700:~/ORBSLAM/tmp/ORB_SLAM3-master/Examples$" afer rebuilding it.

StanleyOf427 avatar Mar 12 '24 07:03 StanleyOf427

I did so and still got the same error. 2024-04-19 16-03-54 的屏幕截图

Yangyang221 avatar Apr 19 '24 08:04 Yangyang221

I did so and still got the same error. 2024-04-19 16-03-54 的屏幕截图

Would you like to provide more information about your environment? What's your Ubuntu , compiler and pangolin version ?

StanleyOf427 avatar Apr 21 '24 05:04 StanleyOf427

hi, My environment as follows: pangolin 0.6,ubuntu20.04

Yangyang221 avatar Apr 21 '24 07:04 Yangyang221