首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >pcl::VoxelGrid<PointXYZ>不与pcl::PointCloud<PointXYZ>一起使用

pcl::VoxelGrid<PointXYZ>不与pcl::PointCloud<PointXYZ>一起使用
EN

Stack Overflow用户
提问于 2018-01-17 10:23:17
回答 2查看 1.4K关注 0票数 0

我现在正在做一些激光扫描,并希望在C++下采样的PointClouds。我在构建过程中遇到了一个奇怪的问题,当我尝试编译代码时,我认为是在库链接期间。这里最小的代码截取了问题的来源:

代码语言:javascript
复制
pcl::PointCloud<pcl::PointXYZ>::Ptr point_cloud_last (new pcl::PointCloud<pcl::PointXYZ>);
pcl::PointCloud<pcl::PointXYZ>::Ptr downsampled (new pcl::PointCloud<pcl::PointXYZ>);
point_cloud_last = _last_pt_cl.makeShared();
pcl::VoxelGrid<pcl::PointXYZ> sor;
sor.setInputCloud (point_cloud_last);
sor.setLeafSize (0.05f, 0.05f, 0.05f);
sor.filter (*downsampled);

当我尝试编译时,我得到了以下错误:

代码语言:javascript
复制
undefined reference to `pcl::VoxelGrid<pcl::PointXYZ>::applyFilter(pcl::PointCloud<pcl::PointXYZ>&)'

我发现,这可能是因为CMakeList中缺少组件。下面是我的CMakeList截图:

代码语言:javascript
复制
find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
cv_bridge
tf
message_generation
)
find_package(OpenCV  REQUIRED)
find_package(PCL 1.7 REQUIRED

如果有人知道出了什么问题,请让我知道。我使用的是Eclipse,PCL1.7,ros indigo。

EN

回答 2

Stack Overflow用户

发布于 2018-03-02 04:29:53

看起来有点晚,但我也遇到了这个问题。在我的案例中,target_link_libraries-lpcl_filters起到了帮助作用。

票数 1
EN

Stack Overflow用户

发布于 2019-08-03 04:15:09

对我有效的方法:

代码语言:javascript
复制
target_link_libraries(my_project ${catkin_LIBRARIES} ${PCL_LIBRARIES})
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48292715

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档