LIOSAM运行ouster和IMU联合标定

https://blog.csdn.net/cyx610481953/article/details/115265585
https://blog.csdn.net/weixin_36773706/article/details/121420828
https://blog.csdn.net/weixin_36773706/article/details/121400779

源码安装ceres与glog

[解压3rd_party.zip压缩包](https://gitee.com/pn_code/Fast-Drone-250)
进入glog文件夹打开终端
./autogen.sh && ./configure && make && sudo make install
sudo apt-get install liblapack-dev libsuitesparse-dev libcxsparse3.1.2 libgflags-dev libgoogle-glog-dev libgtest-dev
进入ceres文件夹打开终端
mkdir build
cd build
cmake ..
sudo make -j4
sudo make install

或者使用apt安装ceres资源

sudo apt install libceres-dev

github下载这两个包。

git clone https://github.com/gaowenliang/code_utils
git clone https://github.com/gaowenliang/imu_utils

安装依赖:

sudo apt-get install libdw-dev

code_utils 依赖 ceres库
imu_utils 依赖 code_utils
先catkin_make code_utils, 再将imu_utils放入编译。
编译code_utils 报错, fatal error: backward.hpp: No such file or directory
解决办法: 在code_utils文件夹下面找到sumpixel_test.cpp,修改#include “backward.hpp” 为 #include“code_utils/backward.hpp”即可编译成功。
然后将imu_utils放入再编译一次。
标定方式一:
直接运行launch,改话题名称即可。

roslaunch imu_utils xxx.launch

增加imu标定包的launch文件如下:

<launch>
    <node pkg="imu_utils" type="imu_an" name="imu_an" output="screen">
        <param name="imu_topic" type="string" value= "/imu_raw"/>
        <param name="imu_name" type="string" value= "xxx"/>
        <param name="data_save_path" type="string" value= "$(find imu_utils)/data/"/>
        <param name="max_time_min" type="int" value= "80"/>
        <param name="max_cluster" type="int" value= "100"/>
    </node>
</launch>

然后运行这个launch文件进行标定。

标定方式二:

录制bag包

rosbag record -o xxxx.bag /imu_raw output

然后运行bag,运行标定程序进行标定。

注:标定时间根据自己设备运行时间来设定,如果设备一般是运行2个小时,那么就标定2个小时即可。输出文件在data文件夹中,我们只需要加速度和角速度的平均噪音和偏置,不需要每个方向的
替换LIO-SAM中config文件夹的配置yaml文件中这四个参数,第五个参数需要连续采样Z轴重力加速度做均值。
在这里插入图片描述
---------------------lidar_align联合标定激光雷达和IMU---------------------------------
https://blog.csdn.net/weixin_47552638/article/details/123364068
使用修正后的代码:lidar_align_wwtx

mkdir -p catkin_ws/src
cd catkin_ws/src/
git clone https://github.com/wwtx/lidar_align_wwtx.git
cd ..
catkin_make
source devel/setup.bash
roslaunch lidar_align lidar_align.launch

编译时遇到的错误
错误一:出现Could not find NLOPTConfig.cmake
解决办法:
安装nlopt库
libnlopt-dev is not enough .

sudo apt install libnlopt-dev
sudo apt install libnlopt-cxx-dev

找到NLOPTConfig.cmake并将其放入到工程目录下,并在CMakeLists.txt里加上这样一句话:
list(APPEND CMAKE_FIND_ROOT_PATH ${PROJECT_SOURCE_DIR})
set (CMAKE_PREFIX_PATH “/usr/local/lib/cmake/nlopt”)
或者
将lidar_align/src/lidar_align/NLOPTConfig.cmake文件移动到lidar_align/src/下

在这里插入图片描述
错误二
error: conflicting declaration ‘typedef struct LZ4_stream_t LZ4_stream_t’ typedef struct { long long table[LZ4_STREAMSIZE_U64]; } LZ4_stream_t

sudo mv /usr/include/flann/ext/lz4.h /usr/include/flann/ext/lz4.h.bak
sudo mv /usr/include/flann/ext/lz4hc.h /usr/include/flann/ext/lz4.h.bak
sudo ln -s /usr/include/lz4.h /usr/include/flann/ext/lz4.h
sudo ln -s /usr/include/lz4hc.h /usr/include/flann/ext/lz4hc.h

录制包含imu和lidar话题的功能包bag
验证imu和雷达安装的方向是否符合要求,需要IMU坐标系和雷达坐标系方向一致https://www.youtube.com/watch?v=BOUK8LYQhHs
控制小车缓慢移动,旋转三个轴,XY轴不要大幅度旋转,录制时间大概2分钟,注意环境中避免出现移动物体,玻璃等反光物体

rosbag record -o ouster_imu.bag  /imu/data  /os_cloud_node/points

record 后面-o(小写)会自动在文件名称后田间当前时间戳,-O(大写)则不会添加时间戳
使用launch文件录制

<launch>
	<node pkg="rosbag" type="record" name="bag_record" args="/imu/data  /os_cloud_node/points -o ouster_imu" />
</launch>

修改lidar_align.launch文件中bag包所在的路径,不用修改任何话题,程序会自己找到话题

](https://img-blog.csdnimg.cn/d102616a0a6c430bb006acf6b80f8e7b.png)

标定的结果文件存放在lidar-align的results文件夹下
在这里插入图片描述
标定结果的使用
打开LIO-SAM/config/params.yaml修改话题名
在这里插入图片描述
将旋转矩阵和平移矩阵分别填入extrinsictrans 平移矩阵和extrinsicrot旋转矩阵:
在这里插入图片描述
Could not find a package configuration file provided by “glog” with any of
the following names:

glogConfig.cmake
glog-config.cmake

git clone  https://gitclone.com/github.com/google/glog 
cd glog
mkdir build
cd build/
cmake ..
make 
sudo make install

Could not find a package configuration file provided by “Pangolin” with any
of the following names:

PangolinConfig.cmake
pangolin-config.cmake
git clone https://github.com/stevenlovegrove/Pangolin.git     
cd Pangolin
mkdir build && cd build
cmake ..
make -j4
sudo make install

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

飞同学

随时为您服务

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值