Introduction
At the tutorial in SSII2012, a brief introduction to the Point Cloud Library(PCL) was provided. It is the library for processing a point cloud (i.e. 3D point group) generated by a depth sensor. The Kinect and Xtion are familiar devices as the depth sensors. Recently I bought the Xtion Pro Live. So, in this page, I describe the procedures to run a sample program in PCL with the Xtion Pro Live.
My Environment
- iMac
- Processor:3.06GHz Intel Core 2 Duo
- Mac OS X 10.7.4
- Xcode 4.3.3
Installation of Prerequisite Libraries
First, I installed the following packages by using macports.
- cmake @2.8.8
- boost @1.49.0
- eigen3 @3.0.5
- flann @1.7.1
- vtk5 @5.8.0
- qhull @2012.1
- libusb @1.0.9
port search
displays.
Only for libusb, the variant universal
is needed.
It takes a long time to compile vtk5.
Next, I downloaded binary packages of the OpenNI and Sensor from this site.
- openni-bin-dev-macosx-v1.5.4.0.tar.bz2
- sensor-bin-macosx-v5.1.2.1.tar.bz2
- nite-bin-macosx-v1.5.2.21.tar.bz2
install.sh
is found for each directory.
All you have to do is just as follows:
At this point, preparation for installing the PCL is completed.
Installation of Point Cloud Library (PCL)
From this site, I could download the binary package of the PCL, and install it easily. However, when compiling a sample program in PCL, the link with the dependent library failed. Probably, it's because the versions of the prerequisite libraries are different from those consistent with the binary package of the PCL. So, I decided to compile the source codes of the PCL. The file PCL-1.5.1-Source.tar.bz2 can be downloaded from this site. The way to
make
is here. The default place where libraries and headers are installed is /usr/local.
Execution of Sample Program
The tool
cmake
is recommended for compiling the program including PCL.
In this page, I show how to compile it on the Xcode4.3.3.
creation of new project
I create a new project as Command Line Tool.adding of a sample program
I added this file to the project.setting for compilation
Other Linker Flags:
-lpcl_common -lpcl_visualization -lboost_thread-mt -lpcl_io -lpcl_filters
Header Search Paths:
/usr/local/include/pcl-1.5/ /opt/local/include /opt/local/include/eigen3/ /usr/include/ni/ /opt/local/include/vtk-5.8/
Library Search Paths:
/usr/local/lib /opt/local/lib
execution
When executing the project after connecting with the Xtion Pro Live, the following error occurred.
Open failed: File not found!
node depth problems
node image problems
node ir problems
This site tells us that
- create a new directory /etc/primesense
- copy the following file into the directory
OpenNI-Bin-Dev-MacOSX-v1.5.4.0/Samples/Config/SamplesConfig.xml
grep
to the file PCL-1.5.1-Source/io/src/openni_camera/openni_device.cpp, and found two places where SamplesConfig.xml must exist:
- /etc/openni/SamplesConfig.xml
- /etc/primesense/SamplesConfig.xml
node ir problems
Unsolved Issues
In the case of Debug mode, the program works well. But, in the case of Release mode, it encounters the segmentation fault.