PCL报错:0x00007FFCA6FC5549 处(位于 XXX.exe 中)有未经处理的异常: Microsoft C++ 异常: pcl::IOException

报错信息

做PCL时报错如下:

错误产生的位置为:

错误原因

registerCallback的参数function定义时候的参数必须是constPtr。

解决方案

注意我们的参数function。

在定义位置有下面两种定义方式:

	boost::function<void(const pcl::PointCloud<PointType>::ConstPtr&)> function = [&pointCloud_XYZRGBA, &mutex](const pcl::PointCloud<PointType>::ConstPtr& ptr) {
		boost::mutex::scoped_lock lock(mutex);
		/* Point Cloud Processing */
		pointCloud_XYZRGBA = ptr->makeShared();
		//ptr->makeShared() = NULL;
	};
	boost::function<void(const pcl::PointCloud<PointType>::Ptr&)> function = [&pointCloud_XYZRGBA, &mutex](const pcl::PointCloud<PointType>::Ptr& ptr) {
		boost::mutex::scoped_lock lock(mutex);
		/* Point Cloud Processing */
		pointCloud_XYZRGBA = ptr->makeShared();
		//ptr->makeShared() = NULL;
	};

第一种方式不会出错。

 

发布了244 篇原创文章 · 获赞 501 · 访问量 50万+

猜你喜欢

转载自blog.csdn.net/shuiyixin/article/details/90643740