Ubuntu 下 Point Cloud Library (PCL)安装

1. 官方给的安装指令如下

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

但这个方法坑比较大,在ubuntu 16.04上总是失败。

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/luohuiwu/article/details/80722082