ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Just to add to codenotes answer, I suggest you also look into pcl_ros as it has a few useful functions for writing ROS messages (in and out of bagfiles) to PCD or PLY files.

For example:

$ rosrun pcl_ros pointcloud_to_pcd input:=/velodyne/pointcloud2

Will subscribe to the /velodyne/pointcloud2 topic and save every message as an individual PCD file. Or, if you want to read data directly from a bagfile...

$ rosrun pcl_ros bag_to_pcd <input_file.bag> <topic> <output_directory>

Can be used to read all the messages on a topic, and save them as individual PCD files. I've used the first command a fair bit, and found it very useful for debugging.

Just to add to codenotes answer, I suggest you also look into pcl_ros as it has a few useful functions for writing ROS messages (in and out of bagfiles) to PCD or PLY files.

For example:

$ rosrun pcl_ros pointcloud_to_pcd input:=/velodyne/pointcloud2

Will subscribe to the /velodyne/pointcloud2 topic and save every message as an individual PCD file. Or, if you want to read data directly from a bagfile...

$ rosrun pcl_ros bag_to_pcd <input_file.bag> <topic> <output_directory>

Can be used to read all the messages on a topic, and save them as individual PCD files. I've used the first command a fair bit, and found it very useful for debugging.