I can read .pcd data using this program.
#include #include #include int main (int argc, char** argv) { pcl::PointCloud<:pointxyz>::Ptr cloud (new pcl::PointCloud<:pointxyz>); if (pcl::io::loadPCDFile<:pointxyz> ("airplane.pcd", *cloud) == -1) //* load the file { PCL_ERROR ("Couldn't read file test_pcd.pcd \n"); return (-1); } std::cout width * cloud->height points.size (); ++i) std::cout points[i].x points[i].y points[i].z
How to read a .ply file i made the following change in line 10:
if (pcl::io::loadPLYFile<:pointxyz> ("airplane.ply", *cloud) == -1) //* load the file
It gave comilation error.
SO i rewrote as:
if (pcl::io::loadPCDFile<:pointxyz> ("airplane.ply", *cloud) == -1) //* load the file
Now it gave me run-time error:
[pcl::PCDReader::readHeader] No points to read Couldn't read file test_pcd.pcd
How to resolve this?