@ubuntu下的PCL安装过程

@ubuntu下的PCL安装过程

转自https://blog.csdn.net/mush_room/article/details/78339578

1. 背景

在PC的ubuntu环境下安装PCL其实是比较简单的过程,但作为linux初学者,看了知*上的一篇文章后却比较蒙,如下:

https://zhuanlan.zhihu.com/p/22217532

这篇文章讲的挺好,过程详细,还指出了网上一些资源的错误,给我很大帮助,在此表示感谢;但有个小问题:预装的时候其实已经可以把PCL依赖的第三方库都装好了,没有必要再单独安装boost,vtk等;当然,cmake还是要装的;

我最初是在ubuntu16.04上安装的,但预装过程就没有通过,折腾挺久,后来换成ubuntu14.04,才安装好了;再后来又在ubuntu17.04上装了一遍;

安装过程中,想找一个写的比较详细,适合于初学者的安装教程,但没有找到,也许接触PCL的都是linux资深玩家,不会遇到我这样的问题;

最后,请问有没有哪位大神把PCL工程交叉编译到了ARM上的,求分享。

2. PCL安装步骤

2.1 预装依赖库

参照:http://pointclouds.org/downloads/linux.html

如果是ubuntu14,则可以使用以下命令

sudo add-apt-repository ppa:v-launchpad-jochen-sprickerhof-de/pcl
sudo apt-get update
sudo apt-get install libpcl-all
但如果是ubuntu16及以上版本,则使用以下命令
sudo add-apt-repository ppa:v-launchpad-jochen-sprickerhof-de/pcl
sudo apt-get update
sudo apt-get install libpcl-dev
注意:如果第三步install的是libpcl-all,会提示无法定位软件包libpcl-all;

update可能会出错,提示:PPA仓库没有Release文件,这个问题可以忽略;

如果install失败,可以再执行一次update,然后install;

2.2 安装PCL

PCL有实时更新的trunk版本,也有Release版本,可择其一安装,trunk版本可能不够稳定;

参照:http://pointclouds.org/documentation/tutorials/compiling_pcl_posix.php

安装trunk版本:

git clone https://github.com/PointCloudLibrary/pcl pcl-trunk
cd pcl-trunk && mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo …
make -j2
sudo make -j2 install

安装Rlease版本(以1.8.1为例):

先下载Release版本: https://github.com/PointCloudLibrary/pcl/releases

cd pcl-pcl-1.8.1 && mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release …
make -j2
sudo make -j2 install

其中,make -j2 执行的时间较长,约45分钟;

装完就可以使用了;

3 测试PCL

我使用的是《点云库PCL学习教程》中的例程,进入工程目录:

mkdir build && cd build

cmake …

make

然后可以执行程序了。

猜你喜欢

转载自blog.csdn.net/xyt723916/article/details/86213401
今日推荐