Turbot-SLAM入门教程-实现cartographer 3D建图(多线雷达rslidar-16版)
Turbot-SLAM入门教程-实现cartographer 3D建图(多线雷达rslidar-16版)
说明
- 介绍利用rslidar-16线雷达实现cartographer 3D建图
录制rosbag
- 查看如何录制rosbag,https://www.ncnynl.com/archives/201810/2759.html
生成pbstream
- 启动roscore
$ roscore
- 回放rosbag,假设你的rosbag名称为:2018-10-22-18-06-10.bag ,放在用户根目录
rosbag play --clock ${HOME}/2018-10-22-18-06-10.bag
- 启动离线3D建图
roslaunch turbot_slam laser_cartographer_demo_3d_offline.launch
- 打开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
- 效果如下:
获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号