Turbot-AI多线入门教程-激光建图-实现Cartographer 2D实时建图
Turbot-AI多线入门教程-激光建图-实现Cartographer 2D实时建图
说明:
- 介绍利用多线雷达rslidar-16版通过cartographer算法实现建图。
- 机型:turbot-AI + 多线雷达rslidar-16版
步骤:
- [turbot]新终端,启动turbot:
$ roslaunch turbot_bringup minimal.launch
- [turbot]新终端,启动激光建图
$ roslaunch turbot_slam laser_cartographer_demo.launch
- [turbot/pc]新终端,启动RVIZ
$ roslaunch turbot_rviz nav.launch
- [turbot/pc]或者启动
$ roslaunch turbot_rviz nav_cartographer.launch
- [turbot/pc]新终端,启动键盘
$ roslaunch turbot_teleop keyboard.launch
- 移动建图,移动turtlebot走圈完成建图,也可以远程控制
- 图示:
保存地图方法1:
- [turbot]新终端,完成建图后保存地图,实际路径是:/home/user/map/
$ rosrun turbot_map saver cartographer_2d_mapping
$ ls ~/map
- 查看内容,包含cartographer_2d_mapping.pgm cartographer_2d_mapping.yaml
- 此方法保存的地图会出现没有边。
保存地图方法2:
- [turbot]新终端,完成建图后保存pbstream
$ rosservice call /finish_trajectory 0
$ rosservice call /write_state ~/map/cartographer_2d_mapping.pbstream 1
- [turbot]转换成ROS地图
rosrun cartographer_ros cartographer_pbstream_to_ros_map -map_filestem=/home/ubuntu/map/cartographer_2d_mapping -pbstream_filename=/home/ubuntu/map/cartographer_2d_mapping.pbstream -resolution=0.05
- 在目录/home/ubuntu/map/下即会出现
cartographer_2d_mapping.pgm
cartographer_2d_mapping.yaml
演示视频
获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号