This page describes how to install pcl-trunk on an Ubuntu 12.04 LTS 64bit machine.
It was tested most recently with pcl trunk a504a690 on 11/13/13.
- Uninstall any prior PCL libraries.
- If you had installed from binary packages or used
checkinstallwhen installing from source previously you can use
sudo apt-get remove ...or
sudo apt-get purge ...which also removes any (possibly modified) configuration files related to the packages. You can list any installed packages with
dpkg-query -l '*pcl*', though it is possible some packages have "pcl" in their name but are not related.
- If you had previously installed from source using
make installand you know the location of the source tree you can run
- Otherwise one method is to run
find /usr/local -name '*pcl*'and then judiciously remove files manually. Of course PCL may have installed some files which don't include the string "pcl" in their name or you may have installed to a different location than
- If you had installed from binary packages or used
- Uninstall any prior OpenNI and Sensor libraries. Use apt-get remove or purge as above. You can search for the packages with
dpkg-query -l '*openni*' '*ps-engine*'. If you installed from source using the primesense
install.shand you know where that source tree is you can run
sudo install.sh -uto uninstall. The README files in the primesense source trees also state what gets installed and where (but be advised that patches commonly applied to these trees may modify the install names and locations and may not update those READMEs).
- To install NVidia binary driver and CUDA see here.
- Use packages from the standard Ubuntu 12.04 repository as much as possible:
- Install OpenNI 1.x binaries from the PCL PPA: This is one of several possible methods to install the primesense OpenNI 1.x (framework) and Sensor (hardware driver) libraries. I recommended this option if you don't need support for Carmine 1.09 (and probably other similarly new devices), which didn't work last I checked (11/9/13). The PCL developers have chosen and tested these versions for best support of common hardware. AFAIK for legal reasons primesense Sensor code only supports Kinect devices on Windows platforms, but with this method you get libraries that have been patched to add Kinect support on other platforms. Note: the versions you will get of these packages can depend on the Ubuntu version you are running. This page reports findings for Ubuntu 12.04.
Package version conflicts with ROS PPA: the openni-dev and ps-engine packages are also available from the ROS PPA, but the ROS and PCL PPAs may have different versions (the libusb package is from the standard Ubuntu repository). If you are unsure from where you got a package you can check the its origin with
apt-cache policy .... In the default configuration, apt-get will install the newest version of a package if multiple versions are available from different repositories. As of 7/20/13, the ROS repository has later versions of openni-dev and ps-engine than the PCL repository. Thus, if you have the ROS repository enabled, you will probably have their packages. This might work just fine, in fact Jochen recommended it as one option for installing a newer version of OpenNI 1.x in Ubuntu 12.04 than the current default version in the PCL PPA for that platform. If you prefer to stick with the PCL PPA only then one option is to disable the ROS repository (remember to apt-get update) and then remove the ROS versions of the packages before installing the PCL versions. Another option is to use the apt preferences system to "pin" these packages to the PCL PPA origin.
Install Alternate Binaries from PPA: The PCL PPA has alternate packages which may be newer than the default ones above for some Ubuntu versions. Last I checked (11/9/13), these also didn't work with Carmine 1.09. Install from Jochen Sprickerhof's github repos: I think these are the source trees from which Jochen produces packages for the PCL PPA. However, last I checked (11/9/13) they contain somewhat newer code. This does work with Carmine 1.09 (firmware 5.7.9) but with some caveats. Install from PrimeSense git repos: This method will install the newest OpenNI and Sensor code from PrimeSense. The commands below modify build options and change the install to
/usr/localbut they do not enable Kinect support on non-Windows platforms like the other methods above. This also works with Carmine 1.09 with caveats. With this method you need to run most OpenNI applications like NiViewer from within the built source tree at
OpenNI/Platform/Linux/Redist/*-Bin-*/Samples/Bin/x64-Release/. Also generated log files will be owned by root. OpenNI Sample Applications: openni-dev and openni-utils come with some binary applications (
dpkg-query -L openni-dev openni-utils | grep bin), with some documentation in the OpenNI User Guide. NiViewer has a lot of features to display and inspect the data (try hitting ? or right-clicking in NiViwer).
Recording OpenNI Data: NiViewer can record live data (depth+rgb) to compressed .oni files, which can be read later in PCL (and also played back later by NiViewer). The required disk write bandwidth seems to be about 4MB/sec (the iotop utility is handy for monitoring this), however it seems the code does not include significant buffering and I did observe hiccups where roughly 1s of frames were dropped after about 30s of recording. The NiBackRecorder app does record to a memory buffer but is not designed for continuous streaming and does not have a live preview. PCL itself seems to include at least 6 ways to record OpenNI data to disk, see here for a rundown.
- Download, build, and install pcl-trunk from github
- If you see "gpu_kinfu_large_scale: Requires surface" in "subsystems will not be built" the first time you run cmake then run the same cmake command line again. The second time gpu_kinfu_large_scale should be in the "will be built" category.
- Change BUILD_apps=ON and BUILD_examples=ON if you want those things built too. AFAIK they are not needed just to build the PCL libraries.
- Different OpenNI versions may not be fully ABI compatible with each other. So you may experience errors if you build PCL against one OpenNI version and then later link apps with a different OpenNI version. I am not sure, this may only apply to the OpenNI framework version, not the Sensor driver version.
- If you get link errors with code that links to PCL libraries, try removing the installed package and re-running the checkinstall. For some reason sometimes the required
*.sofiles (with no version extension) don't get installed into