The Point Cloud Library (PCL) is a standalone, large scale, open project for 2D/3D image and point cloud processing.
PCL is released under the terms of the BSD license, and thus free for commercial and research use. We are financially supported by a consortium of commercial companies, with our own non-profit organization, Open Perception. We would also like to thank individual donors and contributors that have been helping the project.
Rationale: To operate Asus Xtion Pro with Raspberry Pi without taxing CPU too much. We decided to use depth without RGB.
- Install OpenNI. See this instruction
- Install PCL dependencies. The easiest way to do this is to install
libpcl
fromjessie
(which wasn't compiled with OpenNI support). See this instruction. - Clone this repository to a folder, let's say
~/pcl
- Configure:
cd ~/pcl && mkdir build && cd build
ccmake ..
In this step, ensure that you enabled OpenNI support and that the path of OpenNI library is correct. (For the latter, you need to turn on the advance mode. (Press "t") See my configuration for reference. (I also turned many components that I don't need off.)
5. make
and sudo make install
.
Our installation of OpenNI wasn't registered with pkg-config
. Thus, we have to point each project to OpenNI manually. Manually adding OpenNI in CMakeLists.txt
of your project. Add the following text just below the line starting with set(PCL_BUILD_TYPE
set(OPENNI_INCLUDE_DIRS_HINT "/usr/include/ni")
set(OPENNI_LIBRARY_DIRS "/usr/lib/")
set(OPENNI_LIBRARY "/usr/lib/libOpenNI.so")
If you use the example from PCL website, you have both depth and RGB. We'll get only depth. So, we change the binding function to use only XYZ, i.e., replace everything with XYZRGBA
to XYZ
like the following:
boost::function<void (const PointCloud<PointXYZ>::ConstPtr&)> f =
boost::bind(&grabberCallback, _1);
NOTE: May be the example in PCL source code is a better starting point (pcl/io/tools/openni_grabber_depth_example.cpp
). I haven't tested it though.
- Device not found:* edit
sudo nano /usr/etc/primesense/GlobalDefaults.ini
and uncommented;UsbInterface=2
(removing semi colon)