Tuesday, June 16, 2015

Build PCL with OpenNI2 in Ubuntu 14.04

I have built PCL from source and installed it in my Ubuntu 14.04. Everything was fine till these days.

I wanted to rebuild one of my test code in which I used Xition as the input device and it needed OpenNI2. When running ``make'' the system complained that it couldn't find pcl/io/openni2_grabber.h. I checked and found the head file was in the source package but not in the corresponding system folder. So it was something wrong with the make files.

The solution is to turn on the flag BUILD_OPENNI2 which has OFF as the default value[1]. I used
$ grep -r "BUILD_OPENNI2" .
to find it was in the file of CMakeCache.txt. Then just changed the value of from OFF to ON and did make && sudo make install again.