离线录制激光雷达数据进行建图
目前有一个2D激光雷达,自己控制小车运行一段时间,离线获取到激光雷达数据后运行如下代码进行离线建图。
roslaunch cartographer_ros demo_revo_lds.launch bag_filename:=/home/firefly/AutoCar/data/rplidar_s2/2025-01-08-02-08-33.bag
实际效果如下
demo_levo_lds.lua文件
<launch>
<param name="/use_sim_time" value="true" />
<node name="cartographer_node" pkg="cartographer_ros"
type="cartographer_node" args="
-configuration_directory $(find cartographer_ros)/configuration_files
-configuration_basename revo_lds.lua"
output="screen">
<remap from="scan" to="scan" />
</node>
<node name="playbag" pkg="rosbag" type="play"
args="--clock $(arg bag_filename)" />
<node name="rviz" pkg="rviz" type="rviz" required="true"
args="-d $(find cartographer_ros)/configuration_files/demo_2d.rviz" />
</launch>
参考:
Cartographer从小白到跑通再到调试 天坑错误集(持续更新)