1.在ubuntu20.04下,原感知程序需要的是pcl1.8.1,车上其他程序使用的是pcl.1.10.0或者pcl1.10.0,在编译pcl1.10.0时会编译通不过,而pcl1.10.1可以顺利编译通过,安装pcl1.8.1时遇到的问题可能如下,及对应的修改方式。
资源主要在如下网站
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)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.使用智能指针必须在类或者结构体的构造函数中对智能指针进行初始化,申请一片内存空间。