LVI-SAM配置运行

源码地址

源码链接:https://github.com/TixiaoShan/LVI-SAM.git

电脑配置

Ubuntu 18.04 + ROS Melodic + GTSAM 4.0.2 + CERES 1.14.0
pcl1.8+vtk8.2.0+opencv3.2.0

环境配置

ros melodic
参考的安装步骤: Ubuntu18安装ROS
gtsam4.0.2

下载并解压:https://github.com/borglab/gtsam/archive/4.0.2.zip
cd gtsam-4.0.2
mkdir build && cd build
cmake -DGTSAM_BUILD_WITH_MARCH_NATIVE=OFF ..
sudo make install -j4

ceres1.14.0

sudo apt-get install -y libgoogle-glog-dev 
sudo apt-get install -y libatlas-base-dev 
下载并解压: https://github.com/ceres-solver/ceres-solver/archive/1.14.0.zip
cd ceres-solver-1.14.0
git clone https://github.com/ceres-solver/ceres-solver.git
mkdir build && cd build
cmake ..
sudo make install -j4

pcl1.91+vtk8.2.0
参考链接: Ubuntu18.04安装PCL 1.9.1

安装过程出现的问题

未满足依赖问题

sudo apt install 依赖的包

安装VTK时,出现报错

CMake Error at config/Dependencies.cmake:28 (FIND_PACKAGE):
  By not providing "FindQt5Core.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "Qt5Core", but
  CMake did not find one.

  Could not find a package configuration file provided by "Qt5Core"
  (requested version 5.2.0) with any of the following names:

    Qt5CoreConfig.cmake
    qt5core-config.cmake

  Add the installation prefix of "Qt5Core" to CMAKE_PREFIX_PATH or set
  "Qt5Core_DIR" to a directory containing one of the above files.  If
  "Qt5Core" provides a separate development package or SDK, be sure it has
  been installed.
Call Stack (most recent call first):
  CMakeLists.txt:51 (INCLUDE)
-- Configuring incomplete, errors occurred!

查看qt版本

qmake -v

发现安装的是qt4
卸载并重装qt5:

sudo apt-get remove qt4*
sudo apt-get update
sudo apt-get install qt5-default qtcreator

编译

    mkdir ~/catkin_ws/src
    cd ~/catkin_ws/src
    git clone https://github.com/TixiaoShan/LVI-SAM.git
    cd ..
    catkin_make -j4 

注:直接catkin_make会死机

编译过程中出现的问题

carkin_make出现如下报错:

/usr/bin/ld: cannot find -lvtkRenderingOpenGL2
/usr/bin/ld: cannot find -lvtkglew
/usr/bin/ld: cannot find -lvtkRenderingVolumeOpenGL2
/usr/bin/ld: cannot find -lvtkDomainsChemistryOpenGL2
/usr/bin/ld: cannot find -lvtkRenderingGL2PSOpenGL2
/usr/bin/ld: cannot find -lvtkRenderingContextOpenGL2

解决方法:重装pcl
原因:vtk是在pcl安装过程中随着pcl库安装时安装
文章开头提到的参考链接: Ubuntu18.04安装PCL 1.9.1

运行

roslaunch lvi_sam run.launch
rosbag play 数据.bag

运行过程中出现的问题

setup.bash问题

bash: /opt/ros/melodic/setup.bash: 没有那个文件或目录

解决方法:

gedit ~/.bashrc
source /opt/ros/melodic/setup.bash
source ~/catkin_ws/devel/setup.bash
export ROS_PACKAGE_PATH=${ROS_PACKAGE_PATH}:~/catkin_ws/

并且

sudo apt install --reinstall ros-melodic-roslaunch

自建引用包报错

fatal error: visualization_msgs/Marker.h: 没有那个文件或目录

解决方法:

sudo apt-get install ros-melodic-visualization_msgs 

Resource not found: xacro

Resource not found: xacro
ROS path [0]=/opt/ros/melodic/share/ros
ROS path [1]=/home/nssc/catkin_ws/src
ROS path [2]=/opt/ros/melodic/share
ROS path [3]=/home/nssc/catkin_ws/
The traceback for the exception was written to the log file

解决方法:

sudo apt-get install ros-melodic-xacro

image_transport

[lvi_sam_republish-11] process has died [pid 31951, exit code -6, cmd /opt/ros/melodic/lib/image_transport/republish compressed in:=/camera/image_raw raw out:=/camera/image_raw __name:=lvi_sam_republish __log:=/home/nssc/.ros/log/00a8b12a-51da-11ee-be86-78605b2f8867/lvi_sam_republish-11.log].
log file: /home/nssc/.ros/log/00a8b12a-51da-11ee-be86-78605b2f8867/lvi_sam_republish-11*.log

解决方法:

rosrun image_transport republish compressed in:=/camera/image_raw raw out:=/camera/image_raw

报错:

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
已放弃 (核心已转储)

解决方法:

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

没有规则可制作目标

没有规则可制作目标“/usr/local/pcl18/lib/libpcl_common.so”

解决方法:

删除build和devel文件夹重新catkin_make
make[2]: *** 没有规则可制作目标“/usr/lib/x86_64-linux-gnu/libGL.so”

解决方法:

locate libGL.so
#输出:
#/usr/lib/x86_64-linux-gnu/libGL.so.1
#/usr/lib/x86_64-linux-gnu/libGL.so.1.0.0
sudo ln -s /usr/lib/x86_64-linux-gnu/libGL.so.1 /usr/lib/x86_64-linux-gnu/libGL.so

运行结果

开源handheld.bag数据集

roslaunch lvi_sam run.launch
rosbag play handheld.bag

rviz实时:
rviz运行结果最终结果pcd:

请添加图片描述

### LVI-SAM运行Kitti数据集教程与配置方法 #### 一、环境准备 为了成功运行LVI-SAM算法并处理KITTI数据集,需先搭建合适的开发环境。推荐使用Ubuntu操作系统以及ROS框架来简化操作流程[^1]。 安装依赖库时,应确保包含Pangolin、Sophus以及其他必要的C++科学计算库。这些工具对于实现SLAM中的几何变换和可视化功能至关重要。具体命令如下所示: ```bash sudo apt-get install libpangolin-dev libsophus-dev ``` #### 二、数据预处理 由于原始KITTI数据并非直接适用于LVI-SAM输入格式,因此需要完成一系列转换工作。这一步骤涉及将KITTI raw data转化为ROSBAG文件形式以便后续加载到ROS环境中。 可以利用官方提供的脚本或者第三方开源项目如`kitti2bag`来进行此转化过程。下面展示了一个典型调用方式的例子: ```python import kitti2bag converter = kitti2bag.Converter('path_to_kitti_data', 'output_bag_file') converter.convert() ``` #### 三、参数调整 针对不同场景下的性能表现优化,合理设置各项参数显得尤为重要。例如,在初始化阶段设定重投影误差阈值;定义特征点检测器类型及其灵敏度等级等均会影响最终定位精度。 以下是部分关键参数说明: - `reprojection_error_threshold`: 控制匹配过程中允许的最大像素偏差距离。 - `feature_detector_type`: 指定采用哪种算法定位图像上的显著位置(如FAST, ORB)。 #### 四、执行实验 一切准备工作就绪之后,即可启动节点开始测试。通过终端分别开启激光雷达话题订阅者和服务端程序实例化对象两大部分构成整个系统架构的核心逻辑控制单元。 示例启动指令可能类似于这样: ```bash roslaunch lvins_simulator mono_lidar.launch bagfile:=/abs/path/to/input.bag ``` 以上即为基于LVI-SAM框架下对KITTI数据集进行分析的一般步骤概述。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值