首页 > 解决方案 > 如何“正确”初始化和加载 PointCloud

问题描述

我在 Visual Studio 2015 中使用 PCL 1.8.1。以下在调试中工作正常,但在发布模式下它会因未处理的异常而崩溃:

pcl::PointCloud<pcl::PointXYZ>::Ptr cloud(new pcl::PointCloud<pcl::PointXYZ>); pcl::io::loadPCDFile<pcl::PointXYZ>("points.pcd", *cloud );

我猜这与云boost::shared_ptr和调试模式进行一些额外的初始化有关。

我也尝试cloud像这样初始化:

auto cloud = boost::make_shared<pcl::PointCloud<pcl::PointXYZ>>();

或没有Ptr

pcl::PointCloud<pcl::PointXYZ> cloud; pcl::io::loadPCDFile<pcl::PointXYZ>("leaf_raw.pcd", cloud );

但它表现出相同的行为。

标签: point-cloud-library

解决方案


推荐阅读