最新消息:

Turbot-SLAM入门教程-实现cartographer 2D建图(多线雷达rslidar-16版)

Turtlebot2/二代机器人 少儿编程 2066浏览 0评论
Turbot-SLAM入门教程

Turbot-SLAM入门教程-实现cartographer 2D建图(多线雷达rslidar-16版)

说明:

  • 介绍利用多线雷达rslidar-16版通过cartographer算法实现建图。
  • 机型:turbot-DL + 多线雷达rslidar-16版

步骤:

  • 安装cartographer:
    • 参考:cartographer在Turltlebot的应用1-官方安装及补充

测试:

  • 主机,在bashrc里面,设置雷达类型为:rslidar_16
export TURTLEBOT_LASER_SENSOR=rslidar_16
  • 主机,新终端,启动turbot:
$ roslaunch turbot_bringup minimal.launch
  • 主机,新终端,启动激光建图
$ roslaunch turbot_slam laser_cartographer_demo.launch
  • 从机,新终端,启动RVIZ
$ roslaunch turbot_rviz  nav.launch
  • 或者启动
$ roslaunch turbot_rviz  nav_cartographer.launch
  • 从机,新终端,启动键盘
$ roslaunch turbot_teleop  keyboard.launch
  • 移动建图,移动turtlebot走圈完成建图,也可以远程控制

保存地图方法1:

  • 新终端,完成建图后保存地图,实际路径是:/home/user/map/
$ rosrun turbot_map saver rslidar_16_cartographer
$ ls ~/map   
  • 查看内容,包含rslidar_16_cartographer.pgm rslidar_16_cartographer.yaml

  • 此方法保存的地图会出现没有边。

  • 效果图:
    Turbot-SLAM入门教程-实现cartographer 2D建图(多线雷达rslidar-16版)

保存地图方法2:

  • 新终端,完成建图后保存pbstream
rosservice call /write_state ~/map/carto_map.pbstream 1
  • 转换成ROS地图
rosrun cartographer_ros cartographer_pbstream_to_ros_map -map_filestem=/home/ubuntu/map/carto_ros_map -pbstream_filename=/home/ubuntu/map/carto_map.pbstream -resolution=0.05
  • 在目录/home/ubuntu/map/下即会出现
carto_ros_map.pgm
carto_ros_map.yaml

参考:

  • 官方安装:https://google-cartographer-ros-for-turtlebots.readthedocs.io/en/latest/
  • http://blog.exbot.net/archives/2852

您必须 登录 才能发表评论!