gaoxiang12 / slam_in_autonomous_driving

《自动驾驶中的SLAM技术》对应开源代码
1.76k stars 430 forks source link

run_gins_pre_integ报错 #163

Open sunshanlu opened 3 weeks ago

sunshanlu commented 3 weeks ago

当我运行run_gins_pre_integ时,发现错误,以Debug调试时,报错信息如下: run_gins_pre_integ: /usr/include/eigen3/Eigen/src/Core/DenseStorage.h:128: Eigen::internal::plain_array<T, Size, MatrixOrArrayOptions, 32>::plain_array() [with T = double; int Size = 36; int MatrixOrArrayOptions = 0]: Assertion (internal::UIntPtr(eigen_unaligned_array_assert_workaround_gcc47(array)) & (31)) == 0 && "this assertion is explained here: " "http://eigen.tuxfamily.org/dox-devel/group__TopicUnalignedArrayAssert.html" " **** READ THIS WEB PAGE !!! ****"' failed. 调试的结果显示,在run_gins_pre_integ.cc文件的main函数中,sad::GinsPreInteg gins(gins_options);,源头在GinsPreInteg构造函数中的SetOptions函数的preinteg = std::makeshared(options.preintegoptions);`字段出现问题。

我在网上查询了一些资料后,发现用shared_ptr构造含有Eigen矩阵对象时,不会考虑内存对齐的问题,解决方案是使用gcc9版本以上,和c++17标准即可解决这个问题,但是我发现,我电脑上的gcc版本是9.4.0,项目CMakeLists.txt中也明确指明了使用c++17标准,但是还是出现了这类问题,想问一下有人遇到这种情况吗?