解析.bag文件到.pcd点云数据文件
有两种方法:
1、利用bag_to_pcd, 代码如下:(亲测有效)
rosrun pcl_ros bag_to_pcd <*.bag> <topic> <output_directory>
例如:
**1、知道bag文件的topic列表
命令如下:
rosbag info d:\filename.bag
结果如下:
所以bag文件转换成PCD文件命令如下:
rosrun pcl_ros bag_to_pcd d:\b\camera_bag_2021-06-08-09-30-15.bag /lslidar_point_cloud d:\b\
PS:需要在另一个ROS终端上,运行roscore,作为master
2、利用pointcloud_to_pcd, 代码如下:(未测试)
rosrun pcl_ros pointcloud_to_pcd input:=<topic>
参考文章:
https://blog.csdn.net/weixin_40000540/article/details/83859694