0
int main(int argc, char** argv) {

    pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZRGB>);
    pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud_filtered(new pcl::PointCloud<pcl::PointXYZRGB>);

    if (pcl::io::loadPCDFile<pcl::PointXYZRGB>("zweitePC.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;

    pcl::VoxelGrid<pcl::PointXYZRGB> downsample;
    downsample.setInputCloud(cloud);
    downsample.setLeafSize(0.01f, 0.01f, 0.01f);
    downsample.setFilterFieldName("z");
    downsample.setFilterLimits(0, 1.4);
    downsample.filter(*cloud_filtered);

    pcl::visualization::CloudViewer viewer0("Cloud Viewer");
    viewer0.showCloud(cloud_filtered, "pcl_camera4");


    while (!viewer0.wasStopped())
    {
    }

    return (0);
}

我有这个代码使用 PCL 库(1.12.0),它抛出了标题中提到的错误。我不知道为什么,我是 C++ 新手,谷歌搜索错误有助于理解它,但我不知道这个错误发生在哪个上下文中。关闭 CloudViewer(意味着退出 while 循环)后,我收到此错误。有人可以帮我解决这个问题吗?

4

0 回答 0