感知程序从ros切换到cyber_rt框架下,pcl相关问题

在Ubuntu20.04系统中,由于依赖库和版本不兼容,编译PCL1.8.1时遇到了多个错误,包括boost库头文件问题、LZ4压缩库链接错误以及智能指针初始化等。解决方法涉及修改头文件包含路径、修复类型匹配错误、添加链接器选项等。同时,保持cmake版本在3.5左右有助于避免编译失败。
摘要由CSDN通过智能技术生成

1.在ubuntu20.04下,原感知程序需要的是pcl1.8.1,车上其他程序使用的是pcl.1.10.0或者pcl1.10.0,在编译pcl1.10.0时会编译通不过,而pcl1.10.1可以顺利编译通过,安装pcl1.8.1时遇到的问题可能如下,及对应的修改方式。同时应该确保cmake版本维持在3.5左右,版本太高也容易出现编译不过的情况.

资源主要在如下网站

Releases · PointCloudLibrary/pcl · GitHub

(1)

解决:在vlp_grabber.h文件中加入#include<boost/math/special_functions/fpclassify.hpp>

 (2)error 2:#include <boost/uuid/sha1.hpp>

原因:sha1.hpp的路径不对(查找自己电脑上sha1.hpp的路径)

 解决:在pcl_visualizer.cpp中将#include <boost/uuid/sha1.hpp>改为#include <boost/uuid/detail/sha1.hpp>

(3)error 3:error: invalid initialization of reference of type ‘const std::vector<float>&’ from expression of type ‘const boost::shared_ptr<std::vector<float> >’
  144 |         return (plane_coeff_d_);

 解决:在plane_coefficient_comparator.h中的return (plane_coeff_d_)修改为

return (* plane_coeff_d_)

(4)error 4:/bin/ld: ../../lib/libpcl_kdtree.so.1.8.0: undefined reference to `LZ4_resetStreamHC'
/bin/ld: ../../lib/libpcl_kdtree.so.1.8.0: undefined reference to `LZ4_setStreamDecode'
/bin/ld: ../../lib/libpcl_kdtree.so.1.8.0: undefined reference to `LZ4_decompress_safe'
/bin/ld: ../../lib/libpcl_kdtree.so.1.8.0: undefined reference to `LZ4_decompress_safe_continue'
/bin/ld: ../../lib/libpcl_kdtree.so.1.8.0: undefined reference to `LZ4_compress_HC_continue'
解决:/pcl/build/kdtree/CMakeFiles/pcl_kdtree.dir/下的link.txt里在末尾写上:-llz4

(5)error 5:error: no matching function for call to ‘boost::uuids::random_generator_pure::random_generator_pure(boost::random::mt19937*)’ 77 |     boost::uuids::random_generator OutofcoreOctreeDiskContainer<PointT>::uuid_gen_ (&rand_gen_);


 解决:注释octree_disk_container.hpp中的76、77行:

(6)(在ubuntu20.04和麒麟V10下面,这个好像不一定需要,加入后反而报错)error 6:/home/young/pcl-1.8.0/features/include/pcl/features/integral_image_normal.h:254: undefined reference to `pcl::IntegralImageNormalEstimation<pcl::PointXYZ, pcl::Normal>::initData()'
解决:在octree_disk_container.hpp加入#include <pcl/features/normal_3d.h>

(7)error 7:/bin/ld: ../lib/libpcl_recognition.so.1.8.0: undefined reference to `pcl::BOARDLocalReferenceFrameEstimation<pcl::PointXYZRGBA, pcl::Normal, pcl::ReferenceFrame>::computeFeature(pcl::PointCloud<pcl::ReferenceFrame>&)'

 解决:在pcl-1.8.0/features/include/pcl/features/board.h#include <pcl/features/board.h>

最后sudo make install

2.使用智能指针必须在类或者结构体的构造函数中对智能指针进行初始化,申请一片内存空间。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值