复现fast-livo2中遇到的问题以及解决办法

一,如何复现fast-livo2

github链接:https://github.com/hku-mars/FAST-LIVO2?tab=readme-ov-file

gitee链接:Fast-livo2-native: 原生版fast-livo2

根据这下面的说明来即可,一般不会出现大的问题

二,问题

1,报错error: lvalue required as left operand of assignment    32 |   unit_complex_.real() = 1.;

/home/cp/Sophus/sophus/so2.cpp:32:26: error: lvalue required as left operand of assignment    32 |   unit_complex_.real() = 1.;

解决办法:

找到Sophus/sophus目录下的so2.cpp文件

将:

SO2::SO2()
  {
    unit_complex_.real() = 1.;
    unit_complex_.img() = 0.;
  }

改为:

SO2::SO2()
  {
    unit_complex_.real(1.);
    unit_complex_.img(0.);
  }

就解决了。

2,报错:ModuleNotFoundError: No module named 'netifaces'

如果的python很新,和我一样达到了3.9左右,建议你不要直接这样下载:

sudo apt-get install python3-netifaces

因为这个版本太低了,我写文章的这个时间,应该下载的是(0.10.4-1ubuntu4),不适配python3.9

解决办法:

你可以重新输入命令

pip install netifaces==0.11.0

也可去往netifaces · PyPI找到合适自己的版本。

3,报错

terminate called after throwing an instance of 'image_transport::TransportLoadException'
  what():  Unable to load plugin for transport 'compressed', error string:
According to the loaded plugin descriptions the class image_transport/compressed_sub with base class type image_transport::SubscriberPlugin does not exist. Declared types are  image_transport/raw_sub
[republish-4] process has died [pid 7640, exit code -6, cmd /opt/ros/noetic/lib/image_transport/republish compressed in:=/left_camera/image raw out:=/left_camera/image __name:=republish __log:=/home/cp/.ros/log/7b0e0cb0-f366-11ef-a5fb-0be71178afff/republish-4.log].
log file: /home/cp/.ros/log/7b0e0cb0-f366-11ef-a5fb-0be71178afff/republish-4*.log
[republish-4] restarting process
process[republish-4]: started with pid [7656]

从错误信息来看,image_transport 插件加载失败,特别是 compressed 传输类型的插件无法加载。错误指出加载插件描述时,image_transport/compressed_sub 插件类不存在,而系统只能找到 image_transport/raw_sub 插件类。

解决办法:

安装 image_transport_plugins

sudo apt-get install ros-noetic-image-transport-plugins

### 如何复现 FastLiVO2 项目 #### 项目简介与环境准备 FastLiVO 是一种快速且紧密耦合的稀疏直接激光雷达-惯性-视觉里程计(LiDAR-Inertial-Visual Odometry, LIVO),旨在提供高精度的姿态估计解决方案。为了成功复现该项目,需先搭建合适的开发环境。 #### 创建工作空间 创建一个新的ROS工作空间来管理所有的依赖项和源码文件。这一步骤对于保持项目的整洁性和可维护性至关重要[^2]: ```bash mkdir -p ~/fastlivo_ws/src && cd ~/fastlivo_ws/ ``` #### 安装必要的软件包 确保安装了所有必需的库和支持工具。通常情况下,这些可以通过apt-get命令轻松获取。具体到FastLiVO2,则可能涉及到特定版本的PCL(Point Cloud Library)以及其他传感器驱动程序的支持。 #### 获取源代码及相关资源 从官方仓库克隆最新的FastLiVO2源代码至之前创建工作空间中的`src`目录下,并同时拉取其他所需的第三方组件,比如Livox SDK对应的ROS接口实现[^3]: ```bash cd ~/fastlivo_ws/src git clone https://github.com/your-repo-url/fast-livo.git # 替换成实际的FastLiVO2 GitHub链接 git clone https://github.com/Livox-SDK/livox_ros_driver.git ``` #### 编译配置 完成上述准备工作之后,在终端执行CMake编译指令以构建整个工程: ```bash cd ~/fastlivo_ws catkin_make source devel/setup.bash ``` #### 数据集处理与测试运行 最后,通过加载预录制的数据袋(bag file)来进行算法验证。这里假设已经下载了一个适用于评估FastLiVO性能的数据集[^4]: ```bash roslaunch fast_livo mapping_avia.launch rosbag play YOUR_DOWNLOADED.bag ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值