平面提取检测的方法
https://github.com/muratkendir/PlaneDetectionwPCL
报错一:找不到头文件
include路径更改符号,系统不同注意斜杠方向,解决路径报错问题。
对‘pcl::SACSegmentation<pcl::PointXYZ>::segment(pcl::PointIndices&, pcl::ModelCoefficients&)’未定义的引用
warning: ‘pcl::SAC_SAMPLE_SIZE’ is deprecated: This map is deprecated and is kept only to prevent breaking existing user code. Starting from PCL 1.8.0 model sample size is a protected member of the SampleConsensusModel class [-Wdeprecated-declarations]
SAC_SAMPLE_SIZE (sample_size_pairs, sample_size_pairs + sizeof (sample_size_pairs) / sizeof (SampleSizeModel));
报错2:未定义的引用
问题出现在FIND_PACKAGE( PCL REQUIRED COMPONENTS common io visualization )
,后续代码中添加了其他模块调用,还要再添加,这样的方法其实是很麻烦的,我们最好使用FIND_PACKAGE( PCL REQUIRED QUIET)
。
# 增加一个可执行的二进制
ADD_EXECUTABLE( main main.cpp )
# 增加PCL库的依赖
FIND_PACKAGE( PCL REQUIRED COMPONENTS common io visualization )
#list(REMOVE_ITEM PCL_LIBRARIES "vtkproj4") # use this in Ubuntu 16.04
# 增加opencv的依赖
FIND_PACKAGE( OpenCV REQUIRED )