在imu_tk下建立build文件夹, cmake ..时提示usr/share/FindQt4.cmake与Qt5.12.8版本不匹配
查看CmakeList.txt
如何解决呢?当然不是卸载Qt5安装Qt4啊,虽然笔者差点这么做了,哈哈。
我们要安装依赖
sudo apt-get install build-essential cmake libeigen3-dev libqt4-dev libqt4-opengl-dev freeglut3-dev gnuplot
再次cmake ..
perfect!
但进行make时,出现
error: ‘exclusive_scan’ is not a member of ‘std’
260 | std::exclusive_scan(values.begin(), values.end(), result.begin(), 0);
/usr/local/include/ceres/product_manifold.h:309:59: error: expected constructor, destructor, or type conversion before ‘;’ token
309 | ld<Manifold0, Manifold1, Manifolds...>;
我们在CMakeLists.txt中添加SET( CMAKE_CXX_FLAGS "-std=c++17 -O3")再次进行make,完美通过。
以下是编译成功的截图
注:曾试着添加了C++11、14都报错,只有17能编译通过。
接着再执行bin目录下的标定文件
cd bin
./test_imu_calib test_data/xsens_acc.mat test_data/xsens_gyro.mat
执行后又出现了以下问题,真恶心啊!
Importing IMU data from the Matlab matrix file : test_data/xsens_acc.mat
Importing IMU data from the Matlab matrix file : test_data/xsens_gyro.mat
*** stack smashing detected ***: terminated
Aborted (core dumped)
我们如何解决呢?
在CMakeLists.txt中添加add_compile_options(-g -ggdb -O0 -Wall -fstack-protector-all -march=native -fnon-call-exceptions)
接着删除build文件,重新cmake和 make,最后继续在bin中执行
./test_imu_calib test_data/xsens_acc.mat test_data/xsens_gyro.mat
轻松秒杀
完美解决ubuntu20.04中imu_tk中的编译问题后,笔者打算对利用手推的解析求导对 不基于转台的加速度计进行内参标定。敬请期待!
参考链接:
https://github.com/ceres-solver/ceres-solver/issues/789
https://github.com/Kyle-ak/imu_tk/issues/8