我正在研究的一个工具在提升的某个地方崩溃了。在我注意到的调试器中,太多的浊点具有 nan 作为值。我尝试使用下面的代码(来自 PCL 教程)转储文件并得到如下输出:
...
nan nan nan
nan nan nan
nan nan nan
nan nan nan
...
这是对的吗?文件是否损坏?我的阅读程序不适合文件吗?
我正在使用 pcl-1.7。Blow 是转储文件的代码。
感谢您的任何建议!
//s. http://pointclouds.org/documentation/tutorials/reading_pcd.php
#include <iostream>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
int
main (int argc, char** argv)
{
pcl::PointCloud<pcl::PointXYZ>::Ptr cloud (new pcl::PointCloud<pcl::PointXYZ>);
if (pcl::io::loadPCDFile<pcl::PointXYZ> (argv[1], *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 (size_t i = 0; i < cloud->points.size (); ++i)
std::cout << " " << cloud->points[i].x
<< " " << cloud->points[i].y
<< " " << cloud->points[i].z << std::endl;
return (0);
}