yanyan-li / PlanarSLAM

A RGB-D SLAM system for structural scenes, which makes use of point-line-plane features and the Manhattan World assumption.
381 stars 85 forks source link

Segmentation fault on the TranslationOptimization function #6

Open joanpepcompany opened 3 years ago

joanpepcompany commented 3 years ago

Hello, I have only tried some datasets (OF_KT0, LR_KT2, and the rgbd_dataset_freiburg3_long_office_household) with segmentation fault result. It is produced in: https://github.com/yanyan-li/PlanarSLAM/blob/2720f5c112bbb401604623fc3df716936b857894/src/Optimizer.cc#L3462 More accurately, when it is called after the bool Tracking::TranslationEstimation() function. I use Ubuntu 18.04, PCL 1.9 and the version implemented of DBoW2 and g2o by ORB-SLAM runs correctly in my system.

Thanks in advance.

TongQY commented 3 years ago

Hello, I have found the same issue as joanpepcompany. How can I solve this problem? Thank you!

jhwlx commented 3 years ago

Hi, I think it's the same problem with which has been solved in #3 . It may be helpful to comment the following lines in the CMakeLists file under Thirdparty/g2o/CMakeLists.txt and recompile it.

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

There are same lines in the CMakeLists file under Thirdparty/DBoW2/... and I have also commented them to avoid the similar problems. Anyway this system finally works in my laptop( Ubuntu 20.04; Opencv 3.4.0; PCL 1.10 ) after doing all these. It seems the item "-march=native " will affect the compile mode of gcc, but I know little about that so sorry I can't tell the exact reasons. Maybe you can find some clues in https://blog.csdn.net/just_sort/article/details/98485746 Hope this will be helpful to you!

tust13018211 commented 2 years ago

你可以使用自己自带的g2o版本,不要使用他的g2o版本就可以了