1、验证自己的bag

cartographer ROS提供了一个工具cartographer_rosbag_validate来自动分析包中的数据。在尝试调试cartographer之前运行这个工具。

操作方式:

cartographer_rosbag_validate -bag_filename your_bag.bag

2.创建一个.lua配置文件

cartographer非常灵活且可以配置用于任何机器人上。机器人配置读取来自于一个options的数据结构,该数据结构必须定义在一个Lua脚本里面。配置例子定义在文件src/cartographer_ros/cartographer_ros/configuration_files,且安装在install_isolated/share/cartographer_ros/configuration_files/.

注意,理想情况下,一个.lua配置应该是具体机器人的而不是一个具体bag的。

可以通过复制例子中的一个,然后调整以适合自己的需求,

3D SLAM:

cp install_isolated/share/cartographer_ros/configuration_files/backpack_3d.lua install_isolated/share/cartographer_ros/configuration_files/my_robot.lua

2D SLAM:

cp install_isolated/share/cartographer_ros/configuration_files/backpack_3d.lua install_isolated/share/cartographer_ros/configuration_files/my_robot.lua

下面去编辑my_robot.lua来适合于自己的机器人。在options块中定义的值定义了cartographer ros前端应当如何与你的bag进行交互。定义在options段后的值用于调试cartographer的内部信息。

你可能需要调整的值,需要提供环境的TF frame IDs,robot in map_frame, tracking_frame, published_frame and odom_frame.

You can either distribute your robot’s TF tree from a /tf topic in your bag or define it in a .urdf robot definition.

警告:应该信任你的位姿!在机器人和IMU或者LIDAR之间的小的offset可能会导致不相关的地图重构。cartographer通过可以纠正小的位姿误差,但并不是万能的。

需要修改的其他的值有,传感器的数量和类型:

a、num_laser_scans:你使用话题sensor_msgs.LaserScan的数量

b、num_multi_echo_laser_scans:话题num_multi_echo_laser_scans的数量

c、num_point_clouds:话题sensor_msgs/PointCloud2的数量

可以使用use_landmarks和use_nav_sat,来使能路标和GPS作为附加的定位源.在options块中的其他的变量通常保持不变。

然而,有一个全局变量需要调整来适用于自己的bag:

TRAJECTORY_BUILDER_3D.num_accumulated_range_data or TRAJECTORY_BUILDER_2D.num_accumulated_range_data

这个变量定义了构建一个完整激光的信息的数量(通常,是一个完整的分辨率)。如果听从工具cartographer_rosbag_validate的建议,没一帧激光使用100个ROS messages,可以设置这个变量为100。If you have two range finding sensors (for instance, two LIDARs) providing their full scans all at once, you should set this variable to 2.

Create.launch 文件用于自己的SLAM场景

例子中的.launch文件在中src/cartographer_ros/cartographer_ros/launch定义,并安装在install_isolated/share/cartographer_ros/launch/

可以复制下面的例子

cp install_isolated/share/cartographer_ros/launch/backpack_3d.launch install_isolated/share/cartographer_ros/launch/my_robot.launch
cp install_isolated/share/cartographer_ros/launch/demo_backpack_3d.launch install_isolated/share/cartographer_ros/launch/demo_my_robot.launch
cp install_isolated/share/cartographer_ros/launch/offline_backpack_3d.launch install_isolated/share/cartographer_ros/launch/offline_my_robot.launch
cp install_isolated/share/cartographer_ros/launch/demo_backpack_3d_localization.launch install_isolated/share/cartographer_ros/launch/demo_my_robot_localization.launch
cp install_isolated/share/cartographer_ros/launch/assets_writer_backpack_3d.launch install_isolated/share/cartographer_ros/launch/assets_writer_my_robot.launch

my_robot.launch用于在线的SLAM

demo_my_robot.launch应用于研发的机器人上,并期望一个bag_filename参数来重放记录的数据.这个launch文件也会启动一个rviz窗口用于可视化cartographer的状态。

offline_my_robot.launch非常类似于demo_my_robot.launch,但它尝试执行SLAM尽可能的快.这使得地图构建非常快,它也可以用于多个bag文件的地图构建。

demo_my_robot_localication.launch非常类似于demo_my_robot.launch但是它期望一个load_state_filename参数来指出一个.pbstream,它记录了先前cartographer的执行。先前的记录将作为一个预先计算的地图,然后cartographer只会在这个地图上执行定位。

assets_writer_my_robot.launch用于提取.pstream中的数据,.pstream中记录了先前cartographer的执行。

Again, a few adaptations need to be made to those files to suit your robot.

  • Every parameter given to -configuration_basename should be adapted to point to my_robot.lua.
  • If you decided to use a .urdf description of your robot, you should place your description in install_isolated/share/cartographer_ros/urdf and adapt the robot_description parameter to point to your file name.
  • If you decided to use /tf messages, you can remove the robot_description parameter, the robot_state_publisher node and the lines statring with -urdf.
  • If the topic names published by your bag or sensors don’t match the ones expected by Cartographer ROS, you can use <remap> elements to redirect your topics. The expected topic names depend on the type of range finding devices you use.

注意:

  • The IMU topic is expected to be named “imu”
  • If you use only one sensor_msgs/LaserScan topic, it is expected to be named scan. If you have more, they should be named scan_1, scan_2 etc…
  • If you use only one sensor_msgs/MultiEchoLaserScan topic, it is expected to be named echoes. If you have more, they should be named echoes_1, echoes_2 etc…
  • If you use only one sensor_msgs/PointCloud2 topic, it is expected be named points2. If you have more, they should be named points2_1, points2_2, etc…

配置好之后,开始启动

roslaunch cartographer_ros my_robot.launch bag_filename:=/path/to/your_bag.bag

3.在自己的bag上运行Cartographer ROS的更多相关文章

  1. 2.在demo bag上运行cartographer ROS

    注意在运行bag包,之前需要去执行source install_isolated/setup.bash 1.Deutsches Museum 下载并启动2D的backpack demo: wget - ...

  2. 在传统.NET Framework 上运行ASP.NET Core项目

    新的项目我们想用ASP.NET Core来开发,但是苦于我们历史的遗产很多,比如<使用 JavaScriptService 在.NET Core 里实现DES加密算法>,我们要估计等到.N ...

  3. Hyper-V上运行的Linux虚拟机验证是否安装了集成服务

    Hyper-V上运行的Linux虚拟机验证是否安装了集成服务 ps aux|grep "hv"root       311  0.0  0.0      0     0 ?     ...

  4. 通过Mono 在 Heroku 上运行 .NET 应用

    英文原文:Running .NET on Heroku 中文原文:在 Heroku 上运行 .NET 应用 自从加入了Heroku之后,我就想在这个平台上运行.NET程序.现在我很高兴向大家宣布,我们 ...

  5. Linux上运行NET

    今天尝试了下Ubuntu上运行NET程序,按照 https://github.com/aspnet/Home 的指引,一步一步来: 1.安装DNVM(原名KVM) Linux控制台下输入 curl - ...

  6. Mono 4.0 Mac上运行asp.net mvc 5.2.3

    Mono 4.0 已经发布,二进制包已经准备好,具体的发布说明参见:http://www.mono-project.com/docs/about-mono/releases/4.0.0/. 今天在Ma ...

  7. ASP.NET Core 中文文档 第二章 指南(5) 在 Nano Server 上运行ASP.NET Core

    原文 ASP.NET Core on Nano Server 作者 Sourabh Shirhatti 翻译 娄宇(Lyrics) 校对 刘怡(AlexLEWIS).许登洋(Seay).谢炀(kile ...

  8. 【无私分享:ASP.NET CORE 项目实战(第十章)】发布项目到 Linux 上运行 Core 项目

    目录索引 [无私分享:ASP.NET CORE 项目实战]目录索引 简介 ASP.Net Core 给我们带来的最大的亮点就是跨平台,我在我电脑(win7)上用虚拟机建了个 CentOS7 ,来演示下 ...

  9. 玩儿转物联网IoT - 在Beagle Bone Black上运行node.js 程序

    物联网(IoT)技术方兴未艾,智能手环,智能血压计,智能眼镜甚至智能鞋垫都开始进入我们的生活,各种智能设备层出不穷,世界已经到了一个"人有多大胆,地有多大产"的时代,不玩儿点物联网 ...

随机推荐

  1. Flask--(登录注册)抽取视图函数

    视图函数抽取: 在info目录下准备视图业务模块包:modules 在modules中添加首页模块包index 在index包的__init__中导入蓝图 在index的__init__创建蓝图 在i ...

  2. dll文件32位64位检测工具以及Windows文件夹SysWow64的坑【转发】

    原文地址:http://www.cnblogs.com/hbccdf/archive/2014/03/09/3590916.html 自从操作系统升级到64位以后,就要不断的需要面对32位.64位的问 ...

  3. problem:vue组件局部刷新,在组件销毁(destroyed)时取消刷新无效问题

    场景: 一个群发消息列表(数组) 列表下有多条消息(元素) 每条正在发送的消息数据状态需要实时刷新,发送完成时需要显示成功提示符合且不需要刷新,然后3秒消失.首次显示列表时,已经成功的状态不显示这个成 ...

  4. C++Primer第五版——习题答案详解(十)

    习题答案目录:https://www.cnblogs.com/Mered1th/p/10485695.html 第11章 关联容器 练习11.3 #include<iostream> #i ...

  5. pygame 简单播放音乐程序

    环境: python2.7 pygame 功能: 播放指定目录下的歌曲(暂时mp3),可以上一曲.下一曲播放. 文件目录: font  字体文件夹 image  图片文件夹 music  音乐文件夹 ...

  6. win10 安装 oracle 11g

    在安装文件的/stage/cvu文件夹下面找到文件 cvu_prereq.xml文件 64位添加红色部分 32位添加蓝色部分   ............... </OPERATING_SYST ...

  7. 62.纯 CSS 创作一只蒸锅(感觉不好看呀)

    原文地址:https://segmentfault.com/a/1190000015389338 HTML code: <!-- steamer: 蒸锅: lid: 盖子: pot: 锅 --& ...

  8. 注解_Annotation

    ---恢复内容开始--- 一.什么是注解 注解,英文Annotation,它不是程序本身,是对程序的解释,在这里我会想到为什么不能使用注释呢,因为注解是关于程序对信息的处理的流程的一些说明,而且格式也 ...

  9. 转载:Opencv调整运行窗口图片的大小

    本文来自:http://blog.csdn.net/cumtml/article/details/52807961 Opencv在运算时显示图片问题 总结在opencv中,图片显示的问题.简要解决图片 ...

  10. setDaemon 守护线程

    setDaemon(True): 将线程声明为守护线程,必须在start() 方法调用之前设置, 如果不设置为守护线程程序会被无限挂起.这个方法基本和join是相反的. 当我们 在程序运行中,执行一个 ...