直接下载lio-mapping的包下来,然后按照教程操作可以测试:
source devel/setup.zsh
, orsetup.bash
if your preferbash
.roslaunch lio test_indoor.launch &
.roslaunch lio map_4D_indoor.launch &
.rosbag play fast1.bag
.
lio-mapping订阅的topic为:
/imu/data and /velodyne_points
但是当我们使用自己的bag测试时没有反应,然后看config文件中
# Extrinsic parameter between IMU and Camera (adapted from VINS-mono)
estimate_extrinsic: 2 # 0 Have an accurate extrinsic parameters. We will trust the following imu^R_cam, imu^T_cam, don't change it.
# 1 Have an initial guess about extrinsic parameters. We will optimize around your initial guess.
# 2 Don't know anything about extrinsic parameters. You don't need to give R,T. We will try to calibrate it. Do some rotation movement at beginning.
这个参数有点猫腻,原来他参考VINS那样自动优化得到IMU和Lidar的外参,那我们这里要求也不高,直接把它设成0
即可,意思是按照我们给定的外参,不需要他自动优化。
当以为万事大吉时,又出现了一个报错
kyle@kyle:~/ros/kyle_ws$ roslaunch lio test_outdoor.launch
... logging to /home/kyle/.ros/log/3d72b450-9c26-11eb-a769-08d23ee82e11/roslaunch-kyle-29747.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
started roslaunch server http://kyle:35815/
SUMMARY
========
PARAMETERS
* /lio_estimator/config_file: /home/kyle/ros/ky...
* /lio_processor/rad_diff: 0.2
* /rosdistro: melodic
* /rosversion: 1.14.9
NODES
/
lio_estimator (lio/lio_estimator_node)
lio_processor (lio/lio_processor_node)
ROS_MASTER_URI=http://localhost:11311
process[lio_processor-1]: started with pid [29765]
process[lio_estimator-2]: started with pid [29766]
I0413 15:32:54.060197 29765 processor_node.cc:81] Sensor type: 16
[ INFO] [1618299186.991712059]: IMU excitation not enough!
[ INFO] [1618299187.289841677]: IMU excitation not enough!
[ INFO] [1618299187.595478036]: IMU excitation not enough!
[ INFO] [1618299187.877556615]: IMU excitation not enough!
[ INFO] [1618299188.157275748]: IMU excitation not enough!
[ INFO] [1618299188.512538281]: IMU excitation not enough!
[ INFO] [1618299188.775213906]: IMU excitation not enough!
[ INFO] [1618299189.085436131]: IMU excitation not enough!
[ INFO] [1618299189.364731832]: IMU excitation not enough!
[ INFO] [1618299189.714636491]: IMU excitation not enough!
[ INFO] [1618299189.986467154]: IMU excitation not enough!
[ INFO] [1618299190.287896602]: IMU excitation not enough!
[ INFO] [1618299190.602215905]: IMU excitation not enough!
[ INFO] [1618299190.880124531]: IMU excitation not enough!
IMU励磁不足?什么鬼?查了一下,好像是初始启动时运动要足够剧烈才可以,但是我们这个是录好的数据包,没办法改呢,那我们改代码算了,直接把代码里这的判断注释掉:
if (var < 0.25) {
ROS_INFO("IMU excitation not enough!");
return false;
}
重新编译即可使用