fast-LIVO安装测试

安装:

跟着readme就可以

GitHub - hku-mars/FAST-LIVO: A Fast and Tightly-coupled Sparse-Direct LiDAR-Inertial-Visual Odometry.

但安装Sophus要求使用非模板类版本,下载作者推荐得make时会有报错:

/home/zf/LIBS/Sophus/sophus/so2.cpp:32:26: error: lvalue required as left operand of assignment
   32 |   unit_complex_.real() = 1.;
      |                          ^~
/home/zf/LIBS/Sophus/sophus/so2.cpp:33:26: error: lvalue required as left operand of assignment
   33 |   unit_complex_.imag() = 0.;
      |  

参照下文:fatal error: sophus/se3.h: 没有那个文件或目录_古路的博客-CSDN博客

将相关代码改掉即可。

#so2.cpp的构造函数改掉:
//unit_complex_.real() = 1.;
//unit_complex_.imag() = 0.;
unit_complex_.real(1.); 
unit_complex_.imag(0.);

编译有包依赖Sophus时,报错:

/usr/bin/ld: /home/zf/ROS_PROJECT2/devel/lib/libvikit_common.so: undefined reference to `Sophus::SE3::exp(Eigen::Matrix const&)'
/usr/bin/ld: /home/zf/ROS_PROJECT2/devel/lib/libvikit_common.so: undefined reference to `Sophus::SE3::operator=(Sophus::SE3 const&)'
/usr/bin/ld: /home/zf/ROS_PROJECT2/devel/lib/libvikit_common.so: undefined reference to `Sophus::SE3::SE3()'
/usr/bin/ld: /home/zf/ROS_PROJECT2/devel/lib/libvikit_common.so: undefined reference to `Sophus::SE3::SE3(Sophus::SE3 const&)'

解决办法是硬性将cmake链接到/usr/local/lib/libSophus.so上:

find_package(sophus REQUIRED)
set(Sophus_LIBRARIES libSophus.so)
include_directories( ${Sophus_INCLUDE_DIRS} )
target_link_libraries(${PROJECT_NAME} ${Sophus_LIBRARIES})

参考链接:编译报错undefined reference to `Sophus::SE3::operator*(Eigen::Matrix<double, 3, 1, 0, 3, 1> const&) 解决方法_undefined reference to `sophus::so3::so3(eigen::ma_wongHome的博客-CSDN博客

你可能感兴趣的:(多传感器融合,自动驾驶,人工智能)