使用ros2跑mid360的fastlio2建图

fastlio2出了对应的ROS2对应的建图

1.跑通mid360驱动包

可以看我以前的文章教程:https://blog.csdn.net/2301_79618994/article/details/157222625?spm=1001.2014.3001.5501

2.跑通faslio2算法包

在src下面可以git clone

复制代码
git clone -b ros2 https://github.com/Ericsii/FAST_LIO.git --recursive

或者下载了代码可以使用git切换

复制代码
git clone https://github.com/hku-mars/FAST_LIO.git
cd FAST_LIO
git checkout ros2
git submodule update --init --recursive   # 保证依赖也同步

如果你直接colcon build 可能会导致编译报错

复制代码
以下是报错:
core for MP: 3
CMake Warning (dev) at CMakeLists.txt:81 (find_package):
  Policy CMP0074 is not set: find_package uses <PackageName>_ROOT variables.
  Run "cmake --help-policy CMP0074" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  CMake variable PCL_ROOT is set to:

    /usr

  For compatibility, CMake is ignoring the variable.
This warning is for project developers.  Use -Wno-dev to suppress it.

Eigen:/usr/include/eigen3
CMake Error at CMakeLists.txt:95 (add_executable):
  Cannot find source file:

    include/ikd-Tree/ikd_Tree.cpp

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h
  .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc


CMake Error at CMakeLists.txt:95 (add_executable):
  No SOURCES given to target: fastlio_mapping

也就是找不到/ikd-Tree/ikd_Tree.cpp,可能你在看代码的时候,没有这个文件,可以更新模块下载或者单独下载来去放到对应文件夹

复制代码
git clone https://github.com/hku-mars/ikd-Tree.git

3.编译运行

复制代码
cd /home/af/test2
colcon build

ros2 launch fast_lio mapping.launch.py

编译之后就是,打开终端运行

复制代码
cd /home/af/test2
source install/setup.bash
ros2 launch livox_ros_driver2 msg_MID360_launch.py

再打开一个终端

复制代码
cd /home/af/test2
source  install/setup.bash
ros2 launch fast_lio mapping.launch.py

然后就是完成fastlio2建图了,一开始的rviz黑屏,注意那不是黑屏,你把rviz放大就可以看见了,然后add一个grid,就和之前的一样了

相关推荐
Xu_youyaxianshen38 分钟前
Git 零基础常用指令手册(Gitee / GitHub 通用 )
git·gitee·github
染予39 分钟前
上位机时间戳精度不够,时间无法对比怎么解决
单片机·嵌入式硬件
現実君44 分钟前
关于MCU下位替换FPGA的经验与方案
单片机·嵌入式硬件·fpga开发
m0_547486661 小时前
《单片机原理及应用》全套PPT课件2026版
单片机·嵌入式硬件
John_ToDebug1 小时前
Git Stash 完全指南:临时保存工作区的艺术
人工智能·git·agent
十月的皮皮1 小时前
STM32从零到量产开发:四路继电器工业控制模块开发原理小灶 · 合集
stm32·单片机·嵌入式硬件·stm32cubemx·hal库
小羊先生car2 小时前
F429-HAL 库驱动框架(2026/7/22)
单片机·嵌入式硬件
小羊先生car2 小时前
F429-SysTick(2026/7/22)
stm32·单片机·嵌入式硬件
Dlrb12112 小时前
ARM---I.MX6ULL时钟系统详解、时钟树、系统时钟配置等
单片机·嵌入式硬件·arm·imx6ull·pll·时钟树·cortex-a7
智购科技无人售货机工厂2 小时前
自动售货机硬件选型避坑:单片机 / 树莓派 / ESP32 怎么选?~YH
人工智能·单片机·嵌入式硬件·r语言·swift·perl·symfony