raulmur / ORB_SLAM2

Real-Time SLAM for Monocular, Stereo and RGB-D Cameras, with Loop Detection and Relocalization Capabilities
Other
9.42k stars 4.69k forks source link

Segmentation fault (core dumped) #351

Open ahuo002 opened 7 years ago

ahuo002 commented 7 years ago

dicl@ahuo:ORB_SLAM2$ ./Examples/Monocular/mono_kitti Vocabulary/ORBvoc.txt Examp les/Monocular/KITTI03.yaml /media/dicl/Woko/work_space/KITTI/dataset/sequences/00

ORB-SLAM2 Copyright (C) 2014-2016 Raul Mur-Artal, University of Zaragoza. This program comes with ABSOLUTELY NO WARRANTY; This is free software, and you are welcome to redistribute it under certain conditions. See LICENSE.txt.

Input sensor was set to: Monocular

Loading ORB Vocabulary. This could take a while... Vocabulary loaded!

Camera Parameters:

ORB Extractor Parameters:


Start processing sequence ... Images in the sequence: 4541

init done opengl support available New Map created with 171 points Segmentation fault (core dumped)

Then, I try the older vision:https://github.com/shomin/ORB_SLAM2, it works(but no map viewer update).

DxsGeorge commented 7 years ago

Can you try and run it with gdb?

HDaoud commented 7 years ago

I agree with @DxsGeorge try run it in gdb and check where the error is. Although I don't think it's related but why are you running the yaml file of sequence 03 with sequence 00? you should use the 00-02 settings file.

ahuo002 commented 7 years ago

@HDaoud @DxsGeorge Thank you. It works now. Maybe I should not change CMakeList.txt with OpenCV3.2.0 and Eigen3.3.4. But the latest verison: "error: 'usleep' was not declared", then add #include in each file.

InigoCastro commented 6 years ago

Hello.

I am facing the same problem as you but I did not quite understand from your comments how you managed to fix it.

In my case I included #include in every file that prompts the usleep error when building ORB SLAM 2. However, the issue persists and Segmentation fault (core dumped) is displayed when I try to run a EuRoC dataset example. I do not know how to make use of gdb as I just learned about this tool.

EDIT: I just made a fresh rebuild of ORB SLAM 2. It seems that the problem was the lack of usleep in some files. This is solved following #337 . However, I did not detect this issue since ORB SLAM 2 compiled. I believe it somehow managed to compile and the error went undetected, causing the Segmentation fault (core dumped).

EDIT 2: I believe that the fact that it went unnoticed has something to do with OpenCV as I changed from 3.2 to 3.4 recently and I initially did not build ORB SLAM again after the change.

yingyingqin commented 6 years ago

I meet the seam problem, but I don't know how to fix it. @ahuo002 @DxsGeorge

richard-elvira commented 6 years ago

You can run the executable with gdb for view where the core exceptions are. For use it you only need put that follow

gdb Examples/Monocular/mono_euroc

Later the gdb is launched, so you need to run the program with

run here_put_the_parameters_of_orbslam

The code will be executed and when the core dump success you could see in what thread and in what line of code

If you can see the track of the function when it crashes then you can use other command without exit of gdb

bt

And when you finish, you exit to gdb with

quit

yingyingqin commented 6 years ago

Thank You very much, I will try.

JeffreyYH commented 5 years ago

The problem is caused by Eigen. Use version 3.2.10 instead of 3.3.X.

Ankita-Singh-21 commented 3 years ago

Thanks @JeffreyYH , it worked for me

zhuge2333 commented 3 years ago

The problem is caused by Eigen. Use version 3.2.10 instead of 3.3.X.

Thanks, it worked. Eigen V3.3.9 is not compatiable, but 3.2.10 okay

ColieShen commented 2 months ago

Delete all '-march=native' in all cmakelist.txt works for me, including cmakelist in g2o and dbow2 folder. I am working on ubuntu 22.04, eigen 3.2.10, opencv 3.4.16

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}  -Wall  -O3")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall   -O3")
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}  -Wall  -O3 -march=native ")
# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall   -O3 -march=native")