問題:
localization_test: /usr/include/eigen3/Eigen/src/Core/MapBase.h:168:
void Eigen::MapBase<Derived, 0>::checkSanity() const [with Derived = Eigen::Map<Eigen::Matrix<double, 2, 6, 0, 2, 6>, 32, Eigen::Stride<0, 0> >]:
Assertion `((size_t(m_data) % (((int)1 >= (int)internal::traits::Alignment) ? (int)1 : (int)internal::traits::Alignment)) == 0) && “data is not aligned”’ failed.
已放弃 (核心已转储)
參考:
https://blog.csdn.net/wojiushixiangshi/article/details/78356271
按照第一、第二,我对代码进行了修改,但是问题依然没有解决。于是查看pose_estimation_ros功能包的CMakelists.txt,有一行:
set( CMAKE_CXX_FLAGS “-std=c++11 -march=native -O3” )
将-march=native删除.得到
set( CMAKE_CXX_FLAGS “-std=c++11 -O3” )
问题成功解决。
猜测可能是gcc优化后与代码发生了冲突。
本文详细记录了在使用Eigen库时遇到的内存对齐错误,并提供了有效的解决方案。通过调整CMakeLists.txt中的编译选项,成功解决了由gcc优化导致的与代码冲突问题。
373

被折叠的 条评论
为什么被折叠?



