PlanarSLAM icon indicating copy to clipboard operation
PlanarSLAM copied to clipboard

Segmentation fault on the TranslationOptimization function

Open joanpepcompany opened this issue 3 years ago • 3 comments

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.

joanpepcompany avatar May 07 '21 06:05 joanpepcompany

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

TongQY avatar Jun 28 '21 14:06 TongQY

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!

jhwlx avatar Sep 08 '21 13:09 jhwlx

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

tust13018211 avatar Nov 26 '21 08:11 tust13018211