Go to the documentation of this file.00001
00002
00003
00004
00005
00006 #include "pcl/io/pcd_io.h"
00007 #include "pcl/point_types.h"
00008
00009 int main (int argc, char** argv)
00010 {
00011 sensor_msgs::PointCloud2 cloud_blob;
00012 pcl::PointCloud<pcl::PointXYZ> cloud;
00013
00014 if (pcl::io::loadPCDFile ("test_pcd.pcd", cloud_blob) == -1)
00015 {
00016 ROS_ERROR ("Couldn't read file test_pcd.pcd");
00017 return (-1);
00018 }
00019 ROS_INFO ("Loaded %d data points from test_pcd.pcd with the following fields: %s", (int)(cloud_blob.width * cloud_blob.height), pcl::getFieldsList (cloud_blob).c_str ());
00020
00021
00022 point_cloud::fromMsg (cloud_blob, cloud);
00023
00024 std::cout << "Size of point cloud:" << cloud.points.size() << std::endl;
00025
00026
00027
00028 return (0);
00029 }
00030