菜单

FastLIO2雷达定位

下载

本篇内容:如何运行FastLio2算法以及将算法输出的定位发布给无人机实现室内定点飞行

关于FastLIO2

FastLIO2 是一种用于激光雷达里程计和建图的算法,它结合了激光雷达和惯性测量单元(IMU)的数据,以实现实时的高精度定位和地图构建。FastLIO2 是基于 FastLIO 的改进版本,提高了算法的实时性和准确性。

FastLIO2整合包的安装

1.拉取整合包资源

终端 复制代码
git clone https://gitee.com/yundrone_sunray2023/sunray_map.git

2.编译Livox-SDK2(执行以下指令)

终端 复制代码
cd sunray_map
cd app/Livox-SDK2
mkdir build
cd build
cmake .. && make -j
sudo make install

3.编译livox_ros_driver2

终端 复制代码
cd sunray_map
cd src/livox_ros_driver2
./build.sh ROS1

4.编译fast-lio

终端 复制代码
cd sunray_map
catkin_make --source src/fast_lio

5.写入环境变量

复制代码
source path/sunray_map/devel/setup.bash

运行算法(需要先启动雷达)

  • 启动fastlio2节点
复制代码
# 打开终端 启动ros
cd ~/Sunray
roscore

# 启动MID360
roslaunch sunray_planner_util msg_mid360.launch

# 启动FastLio2算法 输出的里程计话题为 /Odometry
roslaunch sunray_planner_utils mapping_mid360.launch rviz:=true
/
mid360驱动运行
/
fastlio2算法运行
/
fastlio2运行结果
  • 将算法输出的里程计作为无人机的定位源
复制代码
# 启动mavros连接无人机
roslaunch sunray_uav_control sunray_mavros_exp.launch 

# 运行外部定位模块 定位源话题为/Odometry
roslaunch sunray_uav_control external_fusion.launch external_source:=0 position_topic:=/Odometry
/
启动mavros节点
/
启动外部定位发布节点
  • 以上操作完成了将FastLio2里程计数据发送到无人机用于定位,接下来可以尝试使用遥控器切换到定点/定高模式的手动飞行
  • 注意检查ERR POS项是否接近与0 如果差值较大可能存在问题
  • 终端会显示无人机的模式和其他状态
上一个
MOCAP动捕定位
下一个
指令飞行与控制
最近修改: 2025-07-04