方式一:
官网prebuild版本
sudo add-apt-repository ppa:v-launchpad-jochen-sprickerhof-de/pcl
sudo apt-get update
sudo apt-get install libpcl-all
ubuntu16.04 使用ppa预安装时,最后一句apt-get install libpcl-all 应该更改为apt-get install libpcl-dev;
可能是因为国内的关系,并没有更新 apt-get 成功;
方式二:
自己编译源码
第一步:安装依赖
$ sudo apt-get install cmake
$ sudo apt-get install g++
$ sudo apt-get install libboost1.55-all-dev
$ sudo apt-get install libeigen3-dev
$ sudo apt-get install libflann-dev
$ sudo apt-get install python
$ sudo apt-get install libusb-1.0-0-dev
$ sudo apt-get install libudev-dev
$ sudo apt-get install openjdk-6-jdk
$ sudo apt-get install freeglut3-dev
$ sudo apt-get install doxygen
$ sudo apt-get install graphviz
$ sudo apt-get install libpng12-dev
$ sudo apt-get install libgtest-dev
$ sudo apt-get install libxmu-dev
$ sudo apt-get install libxi-dev
$ sudo apt-get install libpcap-dev
$ sudo apt-get install libqhull-dev
$ sudo apt-get install libvtk5-qt4-dev
$ sudo apt-get install python-vtk
$ sudo apt-get install libvtk-java
第二步:下载源码
git clone https://github.com/PointCloudLibrary/pcl.git
第三步:编译源码
cd pcl
mkdir release
cd release
cmake -DCMAKE_BUILD_TYPE=None -DBUILD_GPU=ON -DBUILD_apps=ON -DBUILD_examples=ON ..
make
sudo make install
测试示例:
pcl-pcl-1.8.0/doc/tutorials/content/sources下有PCL例程:
如选择的是cloud_viewer文件夹,修改cpp中加载的pcd文件名,并注意路径;
终端进入到cloud_viewer文件夹,执行以下命令:
mkdir build
cd build
sudo cmake ..
sudo make
./cloud_viewer
执行结果: