Ubuntu16.04 &&PCL安装踩坑

为了做点云数据融合,需要安装PCL,开始没想过version,就随便在网上找,很多大佬的博客上都是一套安装流程。源从github上clone下来。这里记录一下pcl-1.9的坑,并一些安装中的问题。

 git clone https://github.com/PointCloudLibrary/pcl.git

 这里下载的是1.9版本,然后安装一大堆依赖库: https://blog.csdn.net/fsencen/article/details/79386570

详细可以看这一篇博文。然而按这种流程安装好了以后,有个visualization的文件无法生成在usr/include的文件中,导致使用可视化模块时报错:无法定位pcl_vsualizer.h头文件的位置。

详查了两天,无法解决!对,网上基本所有方法,都,解决,不,了!推测1.9版本安装包有变化导致一些大佬提供的安装方法useless。

果断rm,如果你已经下载并且出错了找到本文,请按照:https://www.cnblogs.com/zhuxuekui/p/9663335.html这篇,rm掉usr文件夹里的所有pcl生成文件,不行的时候可以尝试用sudo -r进入root权限再试。并按《slam十四讲》中的贴出的安装方法安装1.7版本。也就是:

sudo add-apt-repository ppa:v-launchpad-jochen-sprickerhof-de/pcl
sudo apt-get update
sudo apt-get install libpcl-all

如果安装完成后文件夹中的生成文件没问题。就可以跑例程了。如果很不幸,你的电脑像我一样有各种各样的权限。那么很可能出现问题:

1、https://blog.csdn.net/danmeng8068/article/details/77341532

make[2]: *** No rule to make target '/usr/lib/x86_64-linux-gnu/libproj.so', needed by 'joinMap'.  Stop.
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/joinMap.dir/all' failed
make[1]: *** [CMakeFiles/joinMap.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

解决方法:就是缺少依赖库,sudo apt-get install libproj-dev 装这个。

2、装完,又错:

 50%] Linking CXX executable joinMap
/usr/bin/ld: cannot find -lvtkproj4
collect2: error: ld returned 1 exit status
CMakeFiles/joinMap.dir/build.make:349: recipe for target 'joinMap' failed
make[2]: *** [joinMap] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/joinMap.dir/all' failed
make[1]: *** [CMakeFiles/joinMap.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
*** Failure: Exit code 2 ***
解决方法:需要在cmakelist中加一条指令修复,即在add_executable语句前面加上list(REMOVE_ITEM PCL_LIBRARIES "vtkproj4")

就按上一个链接,完美解决。然后去运行这个joinMap程序,make过了,但是还错:

point cloud size = 0
terminate called after throwing an instance of 'pcl::IOException'
  what():  : [pcl::PCDWriter::writeASCII] Input point cloud has no data!
已放弃 (核心已转储)
https://blog.csdn.net/wuliyanyan/article/details/55515034

解决方法:其实就是你生成的可运行文件不能在没数据的目录下运行,把它复制带=到上一级,跟pose.txt放一起,解决。

但是我运行完并没有出图片,还是不知道咋回事。就这样吧,谢谢各位大佬。

猜你喜欢

转载自blog.csdn.net/weixin_41803139/article/details/86524105