本文转载自:http://www.linuxdiyf.com/linux/24123.html https://zhuanlan.zhihu.com/p/22217532
后面的网址详细介绍了安装pcl的依赖库,PCL安装了一个小时,是很正常的。
一,下载PCL
$ git clone https://github.com/PointCloudLibrary/pcl.git pcl-trunk
$ ln -s pcl-trunk pcl
二,安装库
下面的库大部分都安装过,可以试试
$ 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
三,编译库
$ cd pcl-trunk
$ mkdir build
$ cd build
$ cmake -DCMAKE_BUILD_TYPE=None -DBUILD_GPU=ON -DBUILD_apps=ON -DBUILD_examples=ON ..
$ make
$ sudo make install
四,测试PCL
1、HOME目录下 pcl-trunk->doc->tutorials->content->sources下有PCL例程:这里我选择的是cloud_viewer文件夹下的cloud_viewer.cpp
2、创建demo包
cdcatkinws/src/
catkin_create_pkg demo std_msgs rospy roscpp
3、将cloud_viewer.cpp文件拷贝到demo文件下,同时用cloud_viewer文件夹下的CmakeList.txt代替demo文件夹下的CmakeList.txt文件
4、编译运行cloud_view.cpp源文件
cddemo
sudo cmake .
sudomake
./cloud_viewer