pcd_read.cpp
Go to the documentation of this file.
00001 #include <iostream>
00002 #include <pcl/io/pcd_io.h>
00003 #include <pcl/point_types.h>
00004 
00005 int
00006 main (int argc, char** argv)
00007 {
00008   pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>);
00009 
00010   if (pcl::io::loadPCDFile<pcl::PointXYZ> ("test_pcd.pcd", *cloud) == -1) //* load the file
00011   {
00012     PCL_ERROR ("Couldn't read file test_pcd.pcd \n");
00013     return (-1);
00014   }
00015   std::cout << "Loaded "
00016             << cloud->width * cloud->height
00017             << " data points from test_pcd.pcd with the following fields: "
00018             << std::endl;
00019   for (size_t i = 0; i < cloud->points.size (); ++i)
00020     std::cout << "    " << cloud->points[i].x
00021               << " "    << cloud->points[i].y
00022               << " "    << cloud->points[i].z << std::endl;
00023 
00024   return (0);
00025 }


pcl
Author(s): Open Perception
autogenerated on Mon Oct 6 2014 03:16:25