Turbot3-AI多线入门教程-激光建图-实现Cartographer 2D实时建图
Turbot3-AI多线入门教程-激光建图-实现Cartographer 2D实时建图
说明:
- 介绍利用多线雷达rslidar-16版通过cartographer算法实现建图
- 机型:turbot3-AI + 多线雷达rslidar-16版
操作步骤
- [Turbot3] 新终端,启动turbot3
$ roslaunch turbot3_bringup minimal.launch
- [Turbot3] 新终端,启动激光建图
$ roslaunch turbot3_slam laser_cartographer_demo.launch
- [Turbot3 / Remote PC] 新终端,启动RVIZ
$ roslaunch turbot3_rviz nav.launch
- [Turbot3 / Remote PC] 或者启动
$ roslaunch turbot3_rviz nav_cartographer.launch
- [Turbot3] 新终端,启动键盘
$ roslaunch turbot3_teleop keyboard.launch
移动建图,移动Turbot3走圈完成建图,也可以远程控制
图示:
保存地图方法1
- [Turbot3] 新终端,完成建图后保存地图,实际路径是:/home/user/map/
$ rosrun turbot3_map saver cartographer_2d_mapping
$ ls ~/map
- 查看内容,包含cartographer_2d_mapping.pgm cartographer_2d_mapping.yaml
- 此方法保存的地图会出现没有边。
保存地图方法2
- [Turbot3] 新终端,完成建图后保存pbstream
$ rosservice call /finish_trajectory 0
$ rosservice call /write_state ~/map/cartographer_2d_mapping.pbstream 1
- [Turbot3] 转换成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
获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号