Compilation and all is good. However, when i run it i get the following error:
cesc@ubuntu:~/GIP/intelligentpig/models/PCL/orbbec_integrated_file_creator/build$ ./openniViewer
terminate called after throwing an instance of ‘pcl::IOException’
what(): void pcl::OpenNIGrabber::setupDevice(const string&, const pcl::OpenNIGrabber::Mode&, const pcl::OpenNIGrabber::Mode&) in /build/pcl-TDlAz0/pcl-1.7.2/io/src/openni_grabber.cpp @ 344 : No devices connected.
Aborted (core dumped)
One quick update, I’ve been digging a little bit in the PCL sources and I can see that the OpenNI and OpenNI2 libraries are actually specified in the PCL CMake hierarchy. Do you guys know what changes need to be done in the PCL CMake to point to the Orbbec OpenNI?
Actually, related to that I’ve a dump question, but what is the diffrence between OpenNI and OpenNI2? I assume that for ASTRA and PCL i should only need OpenNI2. Right?
I was able to get the depth image working in the OpenNI2 viewer (bin/pcl_openni2_viewer) to work for PCL 1.8.1.
As noted in other posts in this forum, OpenNI2 is a bit dated and cannot support the color stream of the Astra Pro; however, it can access the depth stream (which is really all I need for my project at the moment.
It looks like PCL’s OpenNI2 viewer is supposed to account for a missing color stream, but it has a few bugs which instead cause it to fail and crash. I had to make a few changes.
visualization/tools/openni2_viewer.cpp
Change this line:
while (!cloud_viewer_->wasStopped () && (image_viewer_ && !image_viewer_->wasStopped ()))
To this:
while (!cloud_viewer_->wasStopped () && (!image_viewer_ || !image_viewer_->wasStopped ()))
After this line:
cout << "Device ID not set, using default device: " << device->getStringID () << endl;
Add the following:
device_id = device->getStringID();
The first fix will allow the loop to work without the color stream. The second fix enables a default device to be used (instead of segfaulting).