I'm working on a project that's using .las lidar files.
I googled and found that PDAL can be used to convert .las to .pcd files, so that I can use the PCL library.
I converted files from .las to .pcd using PDAL.
When I tried to read the pcd files using the following code:
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>);
if (pcl::io::loadPCDFile<pcl::PointXYZ>("C:/Users/hedey/OneDrive/Documents/Research_papers/STDF/10_4231_MFQF-Q141/I-65/LiDAR/RoadSurface/PCD/20180524_I65_NB_RoadSurface_7_53.5.pcd", *cloud) == -1) //* load the file
{
PCL_ERROR("Couldn't read file test_pcd.pcd \n");
return (-1);
}
std::cout << "Loaded "
<< cloud->width * cloud->height
<< " data points from test_pcd.pcd with the following fields: "
<< std::endl;
for (const auto& point : *cloud)
std::cout << " " << point.x
<< " " << point.y
<< " " << point.z << std::endl;
return (0);
The result was as follows, and I'm surprised that all the coordinates in the converted file are all (0,0,0). What might be wrong with this?