1>启动gazebo

 roslaunch mbot_gazebo view_mbot_with_laser_gazebo_suyunzzz_world.launch 

2>启动cartographer

roslaunch cartographer_ros cartographer_demo_rplidar.launch

launch文件如下:

<!--Copyright 2016 The Cartographer AuthorsLicensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.
--><!-- 请复制该文件到cartographer_ros/cartographer_ros/launch中使用 -->
<launch>  <param name="/use_sim_time" value="true" />  <node name="cartographer_node" pkg="cartographer_ros"  type="cartographer_node" args="  -configuration_directory $(find cartographer_ros)/configuration_files  -configuration_basename rplidar.lua"  output="screen">  <remap from="scan" to="scan" />  </node>  <node name="rviz" pkg="rviz" type="rviz" required="true"  args="-d $(find cartographer_ros)/configuration_files/demo_2d.rviz" />
</launch>

其中的rplidar.lua配置文件如下:

-- Copyright 2016 The Cartographer Authors
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
--      http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.-- 请复制该文件到cartographer_ros/cartographer_ros/configuration_files中编译
include "map_builder.lua"
include "trajectory_builder.lua"options = {map_builder = MAP_BUILDER,trajectory_builder = TRAJECTORY_BUILDER,map_frame = "map",tracking_frame = "base_link",published_frame = "odom",odom_frame = "odom",provide_odom_frame = false,use_odometry = true,num_laser_scans = 1,num_multi_echo_laser_scans = 0,num_subdivisions_per_laser_scan = 1,num_point_clouds = 0,lookup_transform_timeout_sec = 0.2,submap_publish_period_sec = 0.3,pose_publish_period_sec = 5e-3,trajectory_publish_period_sec = 30e-3,
}MAP_BUILDER.use_trajectory_builder_2d = trueTRAJECTORY_BUILDER_2D.submaps.num_range_data = 35
TRAJECTORY_BUILDER_2D.min_range = 0.3
TRAJECTORY_BUILDER_2D.max_range = 8.
TRAJECTORY_BUILDER_2D.missing_data_ray_length = 1.
TRAJECTORY_BUILDER_2D.use_imu_data = false
TRAJECTORY_BUILDER_2D.use_online_correlative_scan_matching = true
TRAJECTORY_BUILDER_2D.real_time_correlative_scan_matcher.linear_search_window = 0.1
TRAJECTORY_BUILDER_2D.real_time_correlative_scan_matcher.translation_delta_cost_weight = 10.
TRAJECTORY_BUILDER_2D.real_time_correlative_scan_matcher.rotation_delta_cost_weight = 1e-1SPARSE_POSE_GRAPH.optimization_problem.huber_scale = 1e2
SPARSE_POSE_GRAPH.optimize_every_n_scans = 35
SPARSE_POSE_GRAPH.constraint_builder.min_score = 0.65return options

注:对于lua配置文件中的参数的修改,都需要重新编译cartographer的单独的工作空间使其生效。

3>启动键盘控制节点

rosrun mbot_teleop mbot_teleop.py 

运行如下图:

以上具体文件见 https://github.com/suyunzzz/ROS_homework

ROS使用 cartographer建图相关推荐

  1. 差速小车的Cartographer建图

    目录 在之前的一些文章中,我们创建了DiffCart的仿真模型并能通过键盘控制它. 还为之提供了里程计和IMU用于估计机器人的位姿. 现在我们来给DiffCart装上激光雷达,并使用Cartograp ...

  2. odomimu融合用于Cartographer建图

    任务动机:使用odom&imu融合用于Cartographer建图,提高Cartographer建图时的匹配精度,同时降低运算消耗. 任务描述:使用odom&imu融合用于Cartog ...

  3. Cartographer建图和纯定位

    (一)cartographer在ros下安装参考: 要求: 64-bit, modern CPU (e.g. 3rd generation i7) 16 GB RAM Ubuntu 18.04 (Bi ...

  4. 用自己的机器人实现cartographer建图测试与地图保存应该这样做

    用自己的机器人实现cartographer建图测试与地图保存应该这样做 1.安装 2.测试 3.保存地图 亲测可行.(该教程使用github的代码地址,速度相对慢了一点,极速安装,请看这里: 极速安装 ...

  5. 机器人学习--Turtelbot3学习--如何使用cartographer建图

    问题描述: 按照创客智造官网的教程:https://www.ncnynl.com/category/turtlebot3-tutorial/ 安装好turtlebot3的配套软件后,默认是使用 gma ...

  6. cartographer建图,重定位及发布消息结构为nav_msgs::Odometry的odom话题

    完整功能包(包含carto建图,重定位以及odom话题发布)上传至https://download.csdn.net/download/zhaohaowu/33647981 众所周知,cartogra ...

  7. 【1】Cartographer建图后的原始图像处理(Rviz插件修图)

    修图软件:kolourpaint sudo apt install kolourpaint Cartographer建的地图往往是不能直接用的,需要自己修图清除噪声点和干扰点.除此之外,还需要限定一些 ...

  8. ros学习——gmapping建图

    前言 Gmapping算法 Gmapping是一个基于2D激光雷达使用RBPF(Rao-Blackwellized Particle Filters)算法完成二维栅格地图构建的SLAM(Simulta ...

  9. 工作小笔记——使用Cartographer建图和调优

    文章目录 前言 1. 前提 2. 运行Demo数据 3. 处理自己录制的数据 3.1 录制数据 3.2 验证数据 3.3 构建.lua配置文件 3.4 构建urdf文件 3.5 构建launch文件 ...

最新文章

  1. logstash mysql日期_logstash-input-jdbc取mysql数据日期格式处理
  2. docker操作运行一步一步来
  3. 定位插件_微创新 | 开发PL/SQL插件,快速定位所需字段
  4. 扬州大学复试1301软件工程【期末复习ppt及真题个人复习用】
  5. 牛客网刷题 --- 输入输出数据处理
  6. ios uilabel 垂直居中_iOS – 让UILabel的文字顶部对齐[转载]
  7. MTK 驱动开发(48)---ARM 看门狗机制
  8. 注册表的文件关联及应用
  9. asp之发布给IIS
  10. AtCoder Grand Contest 023
  11. 内网外网双通下的一种网络拓补方案
  12. 计算机安全模式无法启动,电脑安全模式启动不了怎么办
  13. 蓝桥杯——PCF8591
  14. Cannot add or update a child row: a foreign key constraint fails都有哪些原因
  15. 【日常问题解决】docker 映射端口出错
  16. 软件测试丨工具在接口测试中发挥什么样的作用?
  17. javascript 时间倒计时
  18. 中职计算机应用专业教师到电商企业实践报告,中职教师到企业实践总结.doc
  19. 【深度解刨C语言】符号篇(全)
  20. Openlayers测量距离与面积

热门文章

  1. 穿越火线找回装备服务器,装备丢失也不怕 CF手游遗失分解装备找回攻略
  2. 图解固件、驱动、软件的区别
  3. html中调用js带参数传递,JS传参技巧总结
  4. 菜鸟程序员试用期指南,职场新人必备法则
  5. Free software是什么?
  6. linux设备驱动归纳总结(十一):简单的看门狗驱动
  7. ES的安装使用(windows版)
  8. 电影在放映前是如何分发到全国各地的影院的?
  9. 华为设备配置策略路由
  10. IDEA import导入的类明明存在,却飘红,你可以这样做