Point Cloud Library is an open-source library for 3D imaging and point cloud processing. Its numerous state-of-the-art features, such as filtering, feature estimation, and surface reconstruction, make it ideal to use in robot perception. This blog post will walk through how to compile PCL from source on Ubuntu 14.04 and install OpenNI and other required dependencies.
Although some of the PCL dependencies can be installed through the package managers, others require additional work. To keep it simple, open up a command prompt and type in the following two commands to install all of the dependencies:
sudo apt-get update sudo apt-get install build-essential cmake cmake-curses-gui libboost-all-dev libeigen3-dev libflann-dev libglew-dev libxmu-dev libsuitesparse-dev libqhull-dev libpcap-dev libxi-dev libgtest-dev libvtk6-dev libqt5opengl5-dev git git-core freeglut3-dev pkg-config libusb-1.0-0-dev doxygen graphviz mono-complete python
The first command updates the package list in your package repository. The second command installs all of the required dependencies.
In order for PCL to get data from the Kinect camera, PCL must use drivers like OpenNI. However, OpenNI requires Sun’s Java Development Kit. If you do not have JDK, you can use the following commands.
sudo apt-add-repository ppa:webupd8team/java sudo apt-get update sudo apt-get install oracle-java8-installer
To compile OpenNI from source, do:
mkdir ~/kinect cd ~/kinect git clone https://github.com/OpenNI/OpenNI.git
The first two commands makes a kinect directory, and the third command clones the OpenNI repository. Change the branch to unstable:
cd OpenNI git checkout unstable
Run these commands to install OpenNI:
cd Platform/Linux/CreateRedist/ chmod +x RedistMaker ./RedistMaker cd ../Redist/OpenNI-Bin-Dev-Linux-x64-v220.127.116.11 sudo ./install.sh
To install SensorKinect, clone the SensorKinect repository via git:
cd ~/kinect/ git clone https://github.com/ph4m/SensorKinect.git
Then install SensorKinect:
cd SensorKinect/Platform/Linux/CreateRedist/ chmod +x RedistMaker ./RedistMaker cd ../Redist/Sensor-Bin-Linux-x64-v18.104.22.168 chmod +x install.sh sudo ./install.sh
Finally, to install PCL, clone the PCL repository:
git clone https://github.com/PointCloudLibrary/pcl pcl-trunk
Make a pcl-trunk directory and a build directory inside pcl-trunk.
cd pcl-trunk && mkdir build && cd build
Configure PCL with CMake. We will tell it to build in Release (fully optimized, no debug capabilities) mode:
cmake -DCMAKE_BUILD_TYPE=Release ..
CMake should be able to find every dependency, thus being able to build every subsystem except for the ones marked as disabled by default. Build and install:
make sudo make install
Helpful Resources: Here are some additional guides on how to install PCL: http://pointclouds.org/downloads/source.html: This is the official PCL tutorial on how to compile PCL from source. https://github.com/OpenNI/OpenNI: The OpenNI github contains some useful information on how to install OpenNI on Ubuntu. http://larrylisky.com/2014/03/03/installing-pcl-on-ubuntu/: This blog post contains excellent information on compiling both PCL and OpenNI from source and additional dependencies that you may need to install on your computer.