激光slam学习笔记10---ubuntu2004部署运行fastlivo2踩坑记录

背景:mars实验室又发福利啦!跑跑效果,验了那句,mars出品,必属精品!本人pc环境ubuntu20.04,基本流程按照readme走就行,sophus和vikit安装有些注意地方。本文做了一些部署踩坑记录,方便大家参考。

一、报错汇总

报错1

/home/ylh/code_ws/fastlivo/src/FAST-LIVO2/src/vio.cpp: In member function ‘void VIOManager::initializeVIO():
/home/ylh/code_ws/fastlivo/src/FAST-LIVO2/src/vio.cpp:45:13: error:class vk::AbstractCamerahas no member namedfx45 |   fx = cam->fx();
      |             ^~
/home/ylh/code_ws/fastlivo/src/FAST-LIVO2/src/vio.cpp:46:13: error:class vk::AbstractCamerahas no member namedfy46 |   fy = cam->fy();
      |             ^~
/home/ylh/code_ws/fastlivo/src/FAST-LIVO2/src/vio.cpp:47:13: error:class vk::AbstractCamerahas no member namedcx47 |   cx = cam->cx();
      |             ^~
/home/ylh/code_ws/fastlivo/src/FAST-LIVO2/src/vio.cpp:48:13: error:class vk::AbstractCamerahas no member namedcy48 |   cy = cam->cy();
      |             ^~
/home/ylh/code_ws/fastlivo/src/FAST-LIVO2/src/vio.cpp:49:30: error:class vk::AbstractCamerahas no member namedscale49 |   image_resize_factor = cam->scale();

解决方式
根据readme安装vikit(注意使用作者推荐版本)

git clone https://github.com/xuankuzcr/rpg_vikit.git 

注意一些关于sophus的依赖报错,务必安装指定sophus分支,再在cmakelist文件做一些修改,详情看后续报错

报错2

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

解决方式
安装对应的分支

git clone https://github.com/strasdat/Sophus.git
cd Sophus
git checkout a621ff
mkdir build && cd build && cmake ..
make
sudo make install

修改一些报错源码的写法

SO2::SO2()
{
  // unit_complex_.real() = 1.;
  // unit_complex_.imag() = 0.;
  unit_complex_ = std::complex<double>(1,0);
}

参考

报错3

/usr/bin/ld: /home/ylh/code_ws/fastlivo2/devel/lib/libvikit_common.so: undefined reference to `Sophus::SE3::SE3(Eigen::Matrix<double, 3, 3, 0, 3, 3> const&, Eigen::Matrix<double, 3, 1, 0, 3, 1> const&)'
/usr/bin/ld: /home/ylh/code_ws/fastlivo2/devel/lib/libvikit_common.so: undefined reference to `Sophus::SE3::operator*(Eigen::Matrix<double, 3, 1, 0, 3, 1> const&) const'
/usr/bin/ld: /home/ylh/code_ws/fastlivo2/devel/lib/libvikit_common.so: undefined reference to `Sophus::SE3::exp(Eigen::Matrix<double, 6, 1, 0, 6, 1> const&)'
/usr/bin/ld: /home/ylh/code_ws/fastlivo2/devel/lib/libvikit_common.so: undefined reference to `Sophus::SE3::operator*(Sophus::SE3 const&) const'
/usr/bin/ld: /home/ylh/code_ws/fastlivo2/devel/lib/libvikit_common.so: undefined reference to `Sophus::SE3::operator=(Sophus::SE3 const&)'
/usr/bin/ld: /home/ylh/code_ws/fastlivo2/devel/lib/libvikit_common.so: undefined reference to `Sophus::SE3::SE3()'
/usr/bin/ld: /home/ylh/code_ws/fastlivo2/devel/lib/libvikit_common.so: undefined reference to `Sophus::SO3::matrix() const'
/usr/bin/ld: /home/ylh/code_ws/fastlivo2/devel/lib/libvikit_common.so: undefined reference to `Sophus::SE3::SE3(Sophus::SE3 const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [rpg_vikit/vikit_common/CMakeFiles/test_vk_common_camera.dir/build.make:134: /home/ylh/code_ws/fastlivo2/devel/lib/vikit_common/test_vk_common_camera] Error 1
make[1]: *** [CMakeFiles/Makefile2:424: rpg_vikit/vikit_common/CMakeFiles/test_vk_common_camera.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
/usr/bin/ld: /home/ylh/code_ws/fastlivo2/devel/lib/libvikit_common.so: undefined reference to `Sophus::SE3::SE3(Eigen::Matrix<double, 3, 3, 0, 3, 3> const&, Eigen::Matrix<double, 3, 1, 0, 3, 1> const&)'
/usr/bin/ld: /home/ylh/code_ws/fastlivo2/devel/lib/libvikit_common.so: undefined reference to `Sophus::SE3::operator*(Eigen::Matrix<double, 3, 1, 0, 3, 1> const&) const'
/usr/bin/ld: /home/ylh/code_ws/fastlivo2/devel/lib/libvikit_common.so: undefined reference to `Sophus::SE3::exp(Eigen::Matrix<double, 6, 1, 0, 6, 1> const&)'
/usr/bin/ld: /home/ylh/code_ws/fastlivo2/devel/lib/libvikit_common.so: undefined reference to `Sophus::SE3::operator*(Sophus::SE3 const&) const'
/usr/bin/ld: /home/ylh/code_ws/fastlivo2/devel/lib/libvikit_common.so: undefined reference to `Sophus::SE3::operator=(Sophus::SE3 const&)'
/usr/bin/ld: /home/ylh/code_ws/fastlivo2/devel/lib/libvikit_common.so: undefined reference to `Sophus::SE3::SE3()'
/usr/bin/ld: /home/ylh/code_ws/fastlivo2/devel/lib/libvikit_common.so: undefined reference to `Sophus::SO3::matrix() const'
/usr/bin/ld: /home/ylh/code_ws/fastlivo2/devel/lib/libvikit_common.so: undefined reference to `Sophus::SE3::SE3(Sophus::SE3 const&)'
collect2: error: ld returned 1 exit status
make[2]: *** [rpg_vikit/vikit_common/CMakeFiles/test_vk_common_triangulation.dir/build.make:134: /home/ylh/code_ws/fastlivo2/devel/lib/vikit_common/test_vk_common_triangulation] Error 1
make[1]: *** [CMakeFiles/Makefile2:856: rpg_vikit/vikit_common/CMakeFiles/test_vk_common_triangulation.dir/all] Error 2

解决方式
cmakelist文件中加入

set(Sophus_LIBRARIES libSophus.so)//虽然解决了编译问题,但是运行会报错,最终写法如报错6

参考

报错4

error: field ‘fout_imu’ has incomplete type ‘std::ofstream’ {aka ‘std::basic_ofstream<char>}
   52 |   ofstream fout_imu;

解决方式
/IMU_Processing.h加入

#include <fstream>

参考

报错5
提示不同so依赖的opencv版本不一致
本地安装多个opencv版本,而工程依赖ros的4.2.0版本,因此给所有的工程强行指定版本编译

find_package(OpenCV 4.2.0 EXACT REQUIRED)

报错6

/home/ylh/code_ws/fastlivo2/devel/lib/fast_livo/fastlivo_mapping: error while loading shared libraries: libSophus.so: cannot open shared object file: No such file or director

解决方式

set(Sophus_LIBRARIES /usr/local/lib/libSophus.so)

二、运行效果

在这里插入图片描述
###################
好记性不如烂笔头
积跬步期千里
觉得不错的话,记得点赞收藏

### FastLiDAR与FastLIVO2激光雷达技术项目及相关文档 FastLiDAR以及FastLIVO2代表了当前激光雷达(Light Detection And Ranging, LiDAR)领域内较为先进的技术和应用实例之一。这些技术广泛应用于自动驾驶汽车、机器人导航以及其他需要高精度环境感知的应用场景。 #### FastLiDAR 技术概述 FastLiDAR是一种快速处理大规模点云数据的技术方案,旨在提高LiDAR传感器获取的数据处理速度和效率。该技术通过优化算法结构来减少计算资源消耗并加快响应时间,在保持较高测量精度的同时实现了实时性能提升[^1]。 #### FastLIVO2 介绍 FastLIVO2则是基于视觉惯导融合定位的一种高效SLAM (Simultaneous Localization And Mapping) 解决方案。它不仅能够利用LiDAR提供的精确距离信息构建周围环境的地图模型,还能借助相机图像辅助完成更加稳定的姿态估计过程。这种多源传感信息融合的方法显著增强了系统的鲁棒性和适应能力。 #### 相关项目案例 在实际工程项目中,采用上述两项核心技术可以实现多种创新性的应用场景: - **无人驾驶车辆开发**:结合FastLiDAR高效的点云处理能力和FastLIVO2精准可靠的定位功能,为无人车提供全方位的安全保障和支持; - **智能物流仓储管理**:利用这两项技术打造自动化程度更高的货物搬运系统,有效降低人工成本并提高了工作效率; - **地理信息系统更新维护**:凭借其强大的三维建模优势,可定期采集城市地形地貌变化情况用于地图绘制等工作。 对于希望深入了解这两个项目的开发者而言,官方GitHub仓库提供了详尽的API说明文档和技术白皮书下载链接,方便查阅学习。 ```bash git clone https://github.com/your-repo/FastLIVIO.git cd FastLIVIO/docs/ ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值