目录
已经使用非编译gtsam方式安装并运行了Lego-LOAM,
参考:Ubuntu20.04安装LeGO-LOAM【非源码编译GTSAM方式】
此文也用同样的方式,部署并运行了LIO-SAM,如下:
1、使用APT安装ROS的gtsam
使用apt安装如下库:ros-noetic-gtsam/focal,now 4.2.0-2focal.20230620.181134 amd64 [installed]
sudo apt install ros-noetic-gtsam
2、编译 LIO-SAM
下载
cd ~/catkin_ws/src
git clone https://github.com/TixiaoShan/LIO-SAM.git
修改源码
需要修改的部分:
1、~/catkin_ws/src/LIO-SAM/include/utility.h 修改 #include <opencv2/imgproc.hpp>
2、~/catkin_ws/src/LIO-SAM/CMakeLists.txt 修改c++标准: set(CMAKE_CXX_FLAGS “-std=c++14”)
3、对Boost库的引用,修改如下: find_package(Boost REQUIRED COMPONENTS timer thread serialization chrono)
开始编译:
cd ..
catkin_make
3、修改.bashrc,添加工作空间的bash文件
source ~/catkin_ws/devel/setup.bash
4、安装如下2个软件
其他博客中都装,应该是源码内部有使用这些节点的数据;
sudo apt-get install ros-noetic-fake-localization
sudo apt-get install ros-noetic-robot-localization
5、下载bag文件
6、修改launch文件 (将rosbag play合并到了一起)
01-run.launch
<launch>
<arg name="project" default="lio_sam"/>
<!-- Parameters -->
<rosparam file="$(find lio_sam)/config/params.yaml" command="load" />
<!--- LOAM -->
<include file="$(find lio_sam)/launch/include/module_loam.launch" />
<!--- Robot State TF -->
<include file="$(find lio_sam)/launch/include/module_robot_state_publisher.launch" />
<!--- Run Navsat -->
<include file="$(find lio_sam)/launch/include/module_navsat.launch" />
<!--- Run Rviz-->
<include file="$(find lio_sam)/launch/include/module_rviz.launch" />
<arg name="name" default="$(env HOME)/bags/walking_dataset.bag"/>
<node name="playbag" pkg="rosbag" type="play" args="$(arg name) " output="screen" />
</launch>
7、启动运行
roslaunch lio_sam 01-run.launch
8、运行效果
9、针对下载链接中提供的不同包,需要进行不同的配置才能使用;
上面提到的下载链接中的所有包,并不是下载下来后就直接可以使用,有些包需要修改下配置,LIO-SAM Github仓库的主页中已经进行了说明,如下;