基于RPLiDAR A2的cartographer建图
# 启动激光雷达
roslaunch rplidar_ros rplidar.launch
# 可选操作,录制数据
rosbag record /scan
# 启动cartographer
roslaunch cartographer_ros demo_revo_lds.launch
# 完成轨迹, 不接受进一步的数据:
rosservice call /finish_trajectory 0
# 序列化保存其当前状态:
rosservice call /write_state "{filename: '${HOME}/Downloads/mymap302.pbstream'}"
# 将pbstream转换为pgm和yaml
rosrun cartographer_ros cartographer_pbstream_to_ros_map -map_filestem=${HOME}/Downloads/mymap302 -pbstream_filename=${HOME}/Downloads/mymap302.pbstream -resolution=0.05