為了進一步便於分析或者分割點雲數據,時常需要將稀疏點雲激光數據,例如velodyne-16,轉化為RangeImge,此處為一個例程,方便查看轉化是如何完成的
mkdir -p ~/dev/pointcloud_to_rangeimage_ws/src cd ~/dev/pointcloud_to_rangeimage_ws/src git clone https://github.com/artivis/pointcloud_to_rangeimage cd .. catkin_make
此例子生成兩個結點,pointcloud_to_rangeimage_node和rangeimage_to_pointcloud_node,此博客只使用pointcloud_to_rangeimage_node節點如何利用16線激光數據生成RangeImage的測試。首先,我的激光數據的Topic與源文件內聲明的Topic不一致,做如下修改,將 pointcloud_to_rangeimage_node.cpp
sub_ = nh.subscribe<PointCloud>("point_cloud_in", 1, &RangeImageConverter::callback, this);
修改為自己的數據topic
sub_ = nh.subscribe<PointCloud>("/velodyne_points", 1, &RangeImageConverter::callback, this);
1. 啟動roscore 和 rviz
#terminal 1 roscore #termenal 2 rosrun rviz rviz
2. rosbag回放velodyne數據
rosbag play out.bag
out.bag記錄的是topics: /velodyne_points的點雲數據
3. rviz中配置Fixed Frame 和 添加對 LaserScan和Image的觀測
結果如下