项目场景:
笔者在使用Livox_mapping的点云地图做路径规划时,启动move_base发现odom(camera_init) 与map之间的tf无法正常更新,但tf_tree却显示两者之间正常连接。
问题描述
1. move_base报错,找不到 transform from frame [aft_mapped] to frame [map]
Extrapolation Error looking up robot pose: Lookup would require extrapolation 2.254647634s into the past. Requested time 1693479424.000000000 but the earliest data is at time 1693479426.254647732, when looking up transform from frame [aft_mapped] to frame [map]
发现是aft_mapped和map没有即使更新,往前查Livox_mapping的原因。
2. Livox_mapping warning : 时间戳重复
TF_REPEATED_DATA ignoring data with redundant timestamp for frame aft_mapped at time 1693537024.000000 according to authority unknown_publisher
原因分析:
根本原因是Livox_mapping中发布tf [aft_mapped] to frame [camera_init] 时时间戳更新错误,一直打的同一个时间戳。
在代码中每个timestamp调试后发现:
laserCloudCornerLast2 在赋值时前后出现了错误。
laserCloudCornerLast2 定义为float,在赋值出现了精度损失
解决方案:
// float timeLaserCloudCornerLast = 0; // float timeLaserCloudSurfLast = 0; // float timeLaserCloudFullRes = 0; double timeLaserCloudCornerLast = 0; double timeLaserCloudSurfLast = 0; double timeLaserCloudFullRes = 0;
把float换成double
最后用Livox HAP 导航显示正常: