讲解关于slam一系列文章汇总链接:史上最全slam从零开始,针对于本栏目讲解(02)Cartographer源码无死角解析-接如下:
(02)Cartographer源码无死角解析- (00)目录_最新无死角讲解:https://blog.csdn.net/weixin_43013761/article/details/127350885
 
文末正下方中心提供了本人 联系方式, 点击本人照片即可显示 W X → 官方认证 {\color{blue}{文末正下方中心}提供了本人 \color{red} 联系方式,\color{blue}点击本人照片即可显示WX→官方认证} 文末正下方中心提供了本人联系方式,点击本人照片即可显示WX→官方认证

一、前言

通过上一篇博客熟悉了bag文件,如何配置.launch与.lua文件,初步调参。该篇博客会对参数做一个详细的解析。另外,还记录了一些常见错误与解决方式。

二、bag 文件的地址或名称不对

因为为bag文件路径设置错误,如 src/cartographer_ros/cartographer_ros/launch/zwh_rs16_2d_outdoor.launch 文件中,<arg name=“bag_filename” default=“$(env HOME)/ownloads/rslidar-outdoor-gps-notf.bag”/> 参数设置错误,会报错:

[ INFO] [1666593645.197645155]: I1024 14:40:45.000000 79766 configuration_file_resolver.cc:41] Found '/my_work/catkin_ws/install_isolated/share/cartogtory_builder_3d.lua' for 'trajectory_builder_3d.lua'.
[FATAL] [1666593645.227351636]: Error opening file: /root/ownloads/rslidar-outdoor-gps-notf.bag
[ INFO] [1666593645.365874613]: I1024 14:40:45.000000 79766 map_builder_bridge.cc:135] Added trajectory with ID '0'.
[playbag-5] process has died [pid 79798, exit code 1, cmd /opt/ros/melodic/lib/rosbag/play --clock /root/ownloads/rslidar-outdoor-gps-notf.bag __name:f78700-5366-11ed-863f-0242ac110002/playbag-5.log].
log file: /root/.ros/log/c8f78700-5366-11ed-863f-0242ac110002/playbag-5*.log
[ WARN] [1666593648.534747843]: W1024 14:40:48.000000 79766 node.cc:883] Expected topic "points2" (trajectory 0) (resolved topic "/rslidar_points") bue.
[ WARN] [1666593648.534860869]: W1024 14:40:48.000000 79766 node.cc:883] Expected topic "imu" (trajectory 0) (resolved topic "/imu") but no publisher
[ WARN] [1666593648.534901146]: W1024 14:40:48.000000 79766 node.cc:892] Currently available topics are: /move_base_simple/goal,/constraint_list,/subm

本人截图如下:
 

三、launch 订阅话题的名字

launch 订阅话题的名字没有设置对,如把如src/cartographer_ros/cartographer_ros/launch/zwh_rs16_2d_outdoor.launch 文件中rslidar_points参数修改成rslidar_points1,进行错误模拟会产生如下错误:

[ INFO] [1666603816.041083968]: I1024 17:30:16.000000 82604 map_builder_bridge.cc:135] Added trajectory with ID '0'.
[ WARN] [1666603817.071359674, 1606808650.139165979]: Could not compute submap fading: "map" passed to lookupTransform argument target_frame does not exist.
[ WARN] [1666603818.089436676, 1606808651.158864140]: Could not compute submap fading: "map" passed to lookupTransform argument target_frame does not exist.
[ WARN] [1666603819.093072213, 1606808652.166480699]: W1024 17:30:19.000000 82604 node.cc:883] Expected topic "points2" (trajectory 0) (resolved topic "/rslidar_points1") but no publisher is currently active.
[ WARN] [1666603819.093191561, 1606808652.166480699]: W1024 17:30:19.000000 82604 node.cc:892] Currently available topics are: /front_scan,/fix,/constraint_list,/submap_list,/scan_matched_points2,/heading,/rosout,/initialpose,/tf,/move_base_simple/goal,/tf_static,/clock,/imu,/odom_scout,/rosout_agg,/map,/clicked_point,/trajectory_node_list,/rslidar_points,/landmark_poses_list,
[ WARN] [1666603819.163932645, 1606808652.237229789]: Could not compute submap fading: "map" passed to lookupTransform argument target_frame does not exist.
[ WARN] [1666603820.223971311, 1606808653.291531796]: Could not compute submap fading: "map" passed to lookupTransform argument target_frame does not exist.
[ WARN] [1666603821.269292376, 1606808654.340306965]: Could not compute submap fading: "map" passed to lookupTransform argument target_frame does not exist.


Expected topic “points2” (trajectory 0) (resolved topic “/rslidar_points1”) but no publisher is currently active.大概的意思说,期待话题“points2”(轨迹0)(映射成“/rslidar_points1”),但当前没有活动的发布者。并且还会打印当前存在的话题:

 Currently available topics are: /front_scan,/fix,/constraint_list,/submap_list,/scan_matched_points2,/heading,/rosout,/initialpose,/tf,/move_base_simple/goal,/tf_static,/clock,/imu,/odom_scout,/rosout_agg,/map,/clicked_point,/trajectory_node_list,/rslidar_points,/landmark_poses_list,

另外还可以通过前面提到的rqt指令,查看订阅关系,选择Plugins→introspection→Node Graph,如下:

可以看到 /rslidar_points1 是没有发布者的(取消 Leaf topics 的勾选)。

四、坐标系对不上

lua 文件中坐标系设置的不对, 导致 tf 树连不起来, 会在运行时产生 passed to lookupTransform argument source_frame dose not exit 这种问题,bag 的最上边一个坐标系是 odom, 把 src/cartographer_ros/cartographer_ros/configuration_files/lx_rs16_2d_outdoor.lua 里的 published_frame 设置成是odom2, 就会产生如下错误:

[ INFO] [1666611271.256275745, 1606808649.651826394]: I1024 19:34:31.000000 96999 local_trajectory_builder_2d.cc:124] Extrapolator not yet initialized.
[ INFO] [1666611271.273925909, 1606808649.671949345]: I1024 19:34:31.000000 96999 pose_graph_2d.cc:148] Inserted submap (0, 0).
[ WARN] [1666611271.475629726, 1606808649.874053341]: W1024 19:34:31.000000 96999 tf_bridge.cc:52] "odom2" passed to lookupTransform argument source_frame does not exist.
[ WARN] [1666611271.697864728, 1606808650.096038248]: W1024 19:34:31.000000 96999 tf_bridge.cc:52] "odom2" passed to lookupTransform argument source_frame does not exist.
[ WARN] [1666611271.908907496, 1606808650.307406313]: W1024 19:34:31.000000 96999 tf_bridge.cc:52] "odom2" passed to lookupTransform argument source_frame does not exist.
[ WARN] [1666611272.056855406, 1606808650.448873068]: Could not compute submap fading: "map" passed to lookupTransform argument target_frame does not exist.
[ WARN] [1666611272.130697937, 1606808650.529352940]: W1024 19:34:32.000000 96999 tf_bridge.cc:52] "odom2" passed to lookupTransform argument source_frame does not exist

其大概的意思是说 odom2 找不到连接关系:

持此执行rqt指令,选择 plugins→visualization→ tf tree。可以看到其上是没有 odom2 的,因为连接不起来。published_frame 表示的是 map -> footprint 的tf,但是并不会影响其建图。

五、订阅单线点云时设置了 min_z

当我只订阅单线点云, 同时将 min_z 设置成了 0.2, 这时启动建图就会报错,因为单线点云z必须为0,如修改 src/cartographer_ros/cartographer_ros/configuration_files/lx_rs16_2d_outdoor.lua 中的参数如下:

TRAJECTORY_BUILDER_2D.min_z = 0.8
num_laser_scans = 1,                      -- 是否使用单线激光数据
num_point_clouds = 0,                     -- 是否使用点云数据

报错如下:

[ INFO] [1666612930.509022680, 1606808649.581334449]: I1024 20:02:10.000000 111361 ordered_multi_queue.cc:172] All sensor data for trajectory 0 is available starting at '637424054495900860'.
[ WARN] [1666612930.509770022, 1606808649.591392814]: W1024 20:02:10.000000 111361 local_trajectory_builder_2d.cc:218] Dropped empty horizontal range data.
[ INFO] [1666612930.574541128, 1606808649.651753766]: I1024 20:02:10.000000 111361 pose_graph_2d.cc:148] Inserted submap (0, 0).

六、odom 坐标系发布重复

当 bag 或者机器人中本身存在 odom 坐标系, 而 provide_odom_frame 又设置成了 true, 就会导致 odom 坐标系重复发布,会导致机器人位姿发生来回的跳动。如当参数(合理):

  published_frame = "footprint",  odom_frame = "odom",    provide_odom_frame = true,

通过 rqt→plugins→visualization→ tf tree, 可以看到如下:

当参数:

  published_frame = "odom",      odom_frame = "odom",    provide_odom_frame = true,

在实际使用中这样时不合理的,类似于有了一个odom,然后又还提供一个。所以时错误的。这种时候如下所示:

broadcaster 会发生跳动,也就是 odom 来自不同的节点。

七、结语

该篇博客,对 Cartographer 的一些常见错误进行了模拟,并且给出了解决方式。下面就是对一些参数的讲解了,

(02)Cartographer源码无死角解析-(05) 程序运行常见错误与解决→模拟错误相关推荐

  1. (02)Cartographer源码无死角解析-(32) LocalTrajectoryBuilder2D::AddRangeData()→点云的体素滤波

    讲解关于slam一系列文章汇总链接:史上最全slam从零开始,针对于本栏目讲解(02)Cartographer源码无死角解析-链接如下: (02)Cartographer源码无死角解析- (00)目录 ...

  2. (02)Cartographer源码无死角解析-(04) 熟悉bag文件,配置.launch与.lua文件,初步调参

    讲解关于slam一系列文章汇总链接:史上最全slam从零开始,针对于本栏目讲解(02)Cartographer源码无死角解析-链接如下: (02)Cartographer源码无死角解析- (00)目录 ...

  3. (02)Cartographer源码无死角解析-(52) 2D点云扫描匹配→ceres扫描匹配:CeresScanMatcher2D→栅格地图残差

    讲解关于slam一系列文章汇总链接:史上最全slam从零开始,针对于本栏目讲解(02)Cartographer源码无死角解析-链接如下: (02)Cartographer源码无死角解析- (00)目录 ...

  4. (02)Cartographer源码无死角解析-(50) 2D点云扫描匹配→相关性暴力匹配2:RealTimeCorrelativeScanMatcher2D

    讲解关于slam一系列文章汇总链接:史上最全slam从零开始,针对于本栏目讲解(02)Cartographer源码无死角解析-链接如下: (02)Cartographer源码无死角解析- (00)目录 ...

  5. (02)Cartographer源码无死角解析-(49) 2D点云扫描匹配→相关性暴力匹配1:SearchParameters

    讲解关于slam一系列文章汇总链接:史上最全slam从零开始,针对于本栏目讲解(02)Cartographer源码无死角解析-链接如下: (02)Cartographer源码无死角解析- (00)目录 ...

  6. (02)Cartographer源码无死角解析-(48) 2D点云扫描匹配→扫描匹配基本原理讲解,代码总体框架梳理AddAccumulatedRangeData()

    讲解关于slam一系列文章汇总链接:史上最全slam从零开始,针对于本栏目讲解(02)Cartographer源码无死角解析-链接如下: (02)Cartographer源码无死角解析- (00)目录 ...

  7. (02)Cartographer源码无死角解析-(53) 2D后端优化→位姿图优化理论(SPA)讲解、核型函数调用流程

    讲解关于slam一系列文章汇总链接:史上最全slam从零开始,针对于本栏目讲解(02)Cartographer源码无死角解析-链接如下: (02)Cartographer源码无死角解析- (00)目录 ...

  8. (02)Cartographer源码无死角解析-(01) 环境搭建,demo运行,ROS一键安装_清除各种疑难杂症

    讲解关于slam一系列文章汇总链接:史上最全slam从零开始,针对于本栏目讲解(02)Cartographer源码无死角解析链接如下: (02)Cartographer源码无死角解析-(00)目录_最 ...

  9. (01)ORB-SLAM2源码无死角解析-(37) EPnP 算法原理详解→理论基础一:控制点选取、透视投影约束

    讲解关于slam一系列文章汇总链接:史上最全slam从零开始,针对于本栏目讲解的(01)ORB-SLAM2源码无死角解析链接如下: (01)ORB-SLAM2源码无死角解析-(00)目录_最新无死角讲 ...

最新文章

  1. 重启redis命令_redis系列之——数据持久化(RDB和AOF)
  2. 迁移 Express 到函数计算
  3. unity 阳光插件_网络广告,阳光创信保驾护航
  4. ASP.NET Core分布式项目实战(第三方ClientCredential模式调用)--学习笔记
  5. ES基础概念和集群概念
  6. TimeUnit类中的sleep() 和Thread.sleep()
  7. GaMD-高斯加速分子动力学模拟中文教程
  8. 玩拍七不再怕,判断7的倍数有妙招
  9. ROS2与C++入门教程-在C++包里增加python支持
  10. jedis 源码阅读二——jedisPool
  11. STM32F407ZG定时器
  12. 拓嘉辰丰:拼多多订单退款流程有哪些?
  13. 还在相信男女之间真的有纯友谊?太傻太天真!
  14. 作为商家的你必须要在淘宝和拼多多之间二选一?
  15. 飞凌imx6dl lvds闪屏问题记录
  16. 如何判断模型过拟合?那些手段解决过拟合?
  17. 《旅行,孤独,敬业》
  18. 共享存储之SAN,NAS的深入比较
  19. 雷军:穿越人生低谷的感悟(节选)
  20. 亚信安全助手卸载方法

热门文章

  1. matlab contourf设置范围,matplotlib.countourf与matlab.contourf()的区别-matplotlib中的奇数锐边...
  2. Linux的主流发行版
  3. 第一个C语言程序:世界你好.2021-02-19
  4. gmssl编程之X509证书解析
  5. android 4.4拍照问题,Android拍照与相机适配问题汇总
  6. centos7.8下载与安装
  7. Hadoop(HA)
  8. 充分利用集中采购的优势将采购组织打造成为利润中心
  9. 三棱PLC输入(NPN、PNP)
  10. 东野圭吾梦幻花读后感_《梦幻花》-东野圭吾 读后感