Turbot-AI多线入门教程-离线建图-实现Cartographer 3D离线建图
Turbot-AI多线入门教程-离线建图-实现Cartographer 3D离线建图
说明:
- 介绍利用rslidar-16线雷达实现cartographer 3D建图
##使用官方数据包离线建图测试:
- 启动建图:
roslaunch cartographer_ros demo_backpack_3d.launch bag_filename:=${HOME}/rosbag/b3-2016-04-05-14-14-00.bag
###使用自己制数据包离线建图测试:
录制rosbag
- 查看如何录制rosbag, 点击实时建图章节
生成pbstream
- 启动离线3D建图
roslaunch turbot_slam laser_cartographer_demo_3d_offline.launch
- 如果需要更改自己录制的数据包,可以指定如下:
roslaunch turbot_slam laser_cartographer_demo_3d_offline.launch bag_file:=${HOME}/rosbag/rslidar_cartographer_office.bag
- 默认录制的数据包都放在~/rosbag/目录下
- 打开rviz
roslaunch turbot_rviz nav_cartographer_3d.launch
- 效果图如下:
- 生产pbstream,文件位置用户目录下的map目录,名为cartographer_3d.pbstream
rosservice call /finish_trajectory 0
rosservice call /write_state ${HOME}/map/cartographer_3d.pbstream 1
转换成ply点云文件
- 转化pbstream文件为ply点云文件
roslaunch turbot_slam turtlebot_assets_3d.launch bag_filenames:=${HOME}/2018-10-22-18-06-10.bag pose_graph_filename:=${HOME}/map/cartographer_3d.pbstream
- 等待一段时间,完整之后会自动退出,在bag包位置,存在一个名为:.bag_points.ply的文件
转换成pcd文件
- 转化ply点云文件为pcd文件
pcl_ply2pcd 2018-10-22-18-06-10.bag_points.ply cartographer_3d.pcd
- 查看
pcl_viewer cartographer_3d.pcd
- 效果如下:
获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号