Ask Your Question

Revision history [back]

Hopefully this will clear up what you need to do to get this working. Firstly rosbags store ros messages, so you cannot save a cloud in pcd format into one. You'll need to publish the point cloud as a sensor_msgs/PointCloud or sensor_msgs/PointCloud2 message and use rosbag record to write the message into a bag file. It is possible to write ROS messages directly to a rosbag but that is probably unnecessarily complicated in your case.

So you need to read the pcd file as you are now, and then publish it as a point cloud message on a topic. Then you will run your node while using rosbag record to save the point cloud topic to a bag file. I'm not sure what you're trying to do with the next line function?

Hope this helps.