本篇记录RS-LIDAR-16录制bag包,并解析bag包为pcd。
官网操作基本过了一遍,接下来记录标定。相机、雷达设备在出厂前通常都完成了内参标定工作,若要联合使用多雷达或雷达-相机时,就需要进行外参标定。接下来学习并记录标定。
首先找到了内部的一个多雷达标定方法,基于QT开发的标定工具,需要输入pcd文件。但是robosense官方的RSView无法保存pcd文件(其他格式的可以保存eg:pcap,csv,las)

但是可以将PCAP文件转换成pcd文件,看网上教程将PCAP先转换为bag包然后在转换为pcd文件。之前的教程有写过直接录制bag包的方法,所以可以直接用bag转pcd
方式一:
http://wiki.ros.org/pcl_ros
启动roscore,然后运行bag_to_pcd
rosrun pcl_ros bag_to_pcd bag.bag
报错:
Command 'rosrun' not found, but can be installed with:
sudo apt install rosbash
按照提示进行安装
查看bag包的topic列表:
rosbag info **.bag
运行bag_to_pcd:
rosrun pcl_ros bag_to_pcd bag.bag /rslidar_packets pcd
bug:
Provided topic '/rslidar_packets' is in the bag file, but is not of type sensor_msgs/PointCloud2 (type: rslidar_msg/RslidarPacket)
Could not find a sensor_msgs/PointCloud2 type on topic '/rslidar_packets' in bag file /home/pilot/robosense_ws/pcd/bag.bag
Topics found in the bag file:
/rslidar_packets (rslidar_msg/RslidarPacket)
测试失败!!!
参考这篇教程,发现一个问题,本人录制bag包的时候没有加/rslidar_points命令
https://blog.csdn.net/weixin_48657767/article/details/125633367?spm=1001.2014.3001.5502
rosbag record -O mybag.bag /rslidar_points

重新录制bag包,测试成功!
rosrun pcl_ros bag_to_pcd bag3.bag(bag包名称) /rslidar_points(bag包的topic) pcd (保存路径)
rosrun pcl_ros bag_to_pcd bag3.bag /rslidar_points pcd


方式二:利用pointcloud_to_pcd
一个终端通过ros发送messages
rosbag play **.bag
另一个终端接收
rosrun pcl_ros pointcloud_to_pcd input=/rslidar_packets
[ INFO] [1676514476.445249928]: Saving as ASCII PCD
[ INFO] [1676514476.447436508]: Listening for incoming data on topic /input
还是失败!!
使用新的bag测试成功!!
rosrun pcl_ros pointcloud_to_pcd input:=/rslidar_points

本篇结束~感谢我的雷达技术支持带来的帮助!
下篇计划尝试使用相机,然后雷达相机联合使用,进而标定相机和雷达