【fastlio2算法配置】

文章目录

  • 一、仓库地址
  • 二、依赖安装
    • 1.Ubuntu and ROS:
    • 2. Eigen
    • 3. pcl
    • 4. livox
  • 三、rosbag运行示例

一、仓库地址

fastlio2源码

二、依赖安装

1.Ubuntu and ROS:

见我的另一篇博客:xtdrone仿真搭建

2. Eigen

下载地址
选择3.3.4版本,解压后进入

cd eigen-3.3.4
mkdir build
cd build
cmake ..
make
sudo make install

3. pcl

安装ROS的时候自带了

4. livox

livox_ros_sdk:

cd catkin_ws/src
git clone https://github.com/Livox-SDK/Livox-SDK.git
cd Livox-SDK
cd build && cmake ..
make
sudo make install

livox_ros_driver:

cd catkin_ws/src
git clone https://github.com/Livox-SDK/livox_ros_driver.git

然后编译即可,如果遇到:

fatal error: fast_lio/Pose6D.h: No such file or directory
 #include 
fatal error: livox_ros_driver/CustomMsg.h: No such file or directory
 #include 

是消息没有编译到的缘故,使用

catkin_make -j1

三、rosbag运行示例

真实雷达运行算法推荐一个博客,笔者已经测试 :速腾跑fastlio2算法教程
rosbag包:下载地址
如果下载太慢可以看笔者上传的资源,或者联系笔者:[email protected]
首先创建fastlio2算法需要的config:
【fastlio2算法配置】_第1张图片
我下载的rosbag包是32线的,话题名字见附的txt文档,config做对应修改:

common:
    lid_topic:  "/points_raw"   #修改为对应名称
    imu_topic:  "/imu_raw"      #修改为对应名称
    time_sync_en: false         # ONLY turn on when external time synchronization is really not possible
    
preprocess:
    lidar_type: 2                # 1 for Livox serials LiDAR, 2 for Velodyne LiDAR, 3 for ouster LiDAR, 
    scan_line: 32				 #修改为对应线数
    scan_rate: 10                # only need to be set for velodyne, unit: Hz,
    timestamp_unit: 2            # the unit of time/t field in the PointCloud2 rostopic: 0-second, 1-milisecond, 2-microsecond, 3-nanosecond.
    blind: 2                     #这是屏蔽了两米内的点云

mapping:
    acc_cov: 0.1
    gyr_cov: 0.1
    b_acc_cov: 0.0001
    b_gyr_cov: 0.0001
    fov_degree:    180
    det_range:     100.0
    extrinsic_est_en:  false      # true: enable the online estimation of IMU-LiDAR extrinsic,
    extrinsic_T: [ 0, 0, 0.28]
    extrinsic_R: [ 1, 0, 0, 
                   0, 1, 0, 
                   0, 0, 1]

publish:
    path_en:  false
    scan_publish_en:  true       # false: close all the point cloud output
    dense_publish_en: true       # false: low down the points number in a global-frame point clouds scan.
    scan_bodyframe_pub_en: true  # true: output the point cloud scans in IMU-body-frame

pcd_save:
    pcd_save_en: true
    interval: -1                 # how many LiDAR frames saved in each pcd file; 
                                 # -1 : all frames will be saved in ONE pcd file, may lead to memory crash when having too much frames.

我复制了一个launch文件:
【fastlio2算法配置】_第2张图片
将yaml文件改为我们刚才编辑的

>

启动

cd catkin_ws/
roslaunch fast_lio mapping_velodyne_32_bag.launch 
cd your_bag_dir
rosbag play fastlio.bag 

生成的地图可在目录 :~/catkin_ws/src/FAST_LIO/PCD
使用pcl_view查看:

sudo apt install pcl-tools
pcl_viewer scans.pcd

效果如图:
【fastlio2算法配置】_第3张图片
如果遇到rviz不显示点云:解决方案

你可能感兴趣的:(自动驾驶,目标检测)