As far as I know OfxOpenNI is the only way to get Skeleton data using OpenFrameworks (at least on OSX)
ofxOpenNI2 - abandoned, supports only Windows SDK
ofxKinect - no skeleton data
So I have an ambitious plan to make OfxOpenNI 0.9.2+ compatible. I am not a pro developer so this is quite challenging for me. Currently the biggest issue is to get rid of POCO and multithreading stuff that has been deprecated in 0.9.1 (if I’m not mistaken). I found a pull request which explains that we have to remove POCO to make everything c++11 compatible, but i found nothing on what should I use instead… https://github.com/openframeworks/openFrameworks/pull/3913
Can anyone explain which direction should i look? And is my idea of digging OfxOpenNI from the grave is right in general? Maybe there are other alternatives?
theanks @fresla! The ‘deafault’ example is working fine. (it’s detecting the hands ‘in boxes’)
but renaming the other ‘src’ files to check the other examples are not working. No kinect deetected and I am getting this:
> [verbose] ofxOpenNIDevice[0]: Adding licence: PrimeSense 0KOIk2JeIBYClPWVnMoRKn5cdY4=status:OK
> [notice ] ofxOpenNIDevice[0]: Init device…
> [verbose] ofxOpenNIDevice[0]: Enumerate devicesstatus:Can’t create any node of the requested type!
> [notice ] ofxOpenNIDevice[0]: Found0devices connected
> [warning] ofxOpenNIDevice[0]: REAL Device could not be initialized - you can still use an ONI
> [notice ] ofxOpenNIDevice[0]: Adding generator typeXN_NODE_TYPE_DEPTH
Must I modify the other src/testApp.h and .cpp in some way? It’s something related to searching of multiple devices?
cool thanks. when I use the default example it’s detected fine. I am getting the error only in the other ones, when it gets a ‘list of multiple devices’. The Kinect it’s connected on the same way…
fresla: Your example does not work in 0.9.2… However it will work in 0.9.0, because POCO is still there… Well at least on OSX i get the same errors as in files from gameoverhack/ofxOpenNI repo.
Hi fresla, I can compile your example, but seems the kinect did not initiate. It happens in all examples.
I have the following warnings:
[notice ] ofxOpenNIDevice[0]: Init context…
[verbose] ofxOpenNIDevice[0]: Context initilizedstatus:OK
[notice ] ofxOpenNIDevice[0]: openni driver version: 1.5.4.0
[notice ] ofxOpenNIDevice[0]: Adding licence…
[verbose] ofxOpenNIDevice[0]: Adding licence: PrimeSense 0KOIk2JeIBYClPWVnMoRKn5cdY4=status:OK
[notice ] ofxOpenNIDevice[0]: Init device…
[verbose] ofxOpenNIDevice[0]: Enumerate devicesstatus:OK
[notice ] ofxOpenNIDevice[0]: Found1devices connected
[verbose] ofxOpenNIDevice[0]: Creating production tree for device 0status:Failed to open the USB device!
[warning] ofxOpenNIDevice[0]: REAL Device could not be initialized - you can still use an ONI
[notice ] ofxOpenNIDevice[0]: Adding generator typeXN_NODE_TYPE_IMAGE
[verbose] ofxOpenNIDevice[0]: Creating XN_NODE_TYPE_IMAGE generatorstatus:Can’t create any node of the requested type!
[ error ] ofxOpenNIDevice[0]: setGeneratorResolution() called on invalid generator!
[notice ] ofxOpenNIDevice[0]: Adding generator typeXN_NODE_TYPE_DEPTH
[verbose] ofxOpenNIDevice[0]: Creating XN_NODE_TYPE_DEPTH generatorstatus:Failed to open the USB device!
[ error ] ofxOpenNIDevice[0]: setGeneratorResolution() called on invalid generator!
[verbose] ofxOpenNIDevice[0]: Depth generator is not on
[notice ] ofxOpenNIDevice[0]: Adding generator typeXN_NODE_TYPE_HANDS
[verbose] ofxOpenNIDevice[0]: Creating XN_NODE_TYPE_HANDS generatorstatus:Failed to open the USB device!
[verbose] ofxOpenNIDevice[0]: Starting XN_NODE_TYPE_HANDS generatorstatus:Failed to open the USB device!
[verbose] ofxOpenNIDevice[0]: Creating XN_NODE_TYPE_GESTURE generator for focus gestures (needed with hands)status:Failed to open the USB device!
[verbose] ofxOpenNIDevice[0]: Starting XN_NODE_TYPE_HANDS generatorstatus:Failed to open the USB device!
[ error ] ofxOpenNIDevice[0]: Can’t add all focus gestures as there isn’t a gesture generator - use addHandsGenerator() first
[notice ] ofxOpenNIDevice[0]: Starting ofxOpenNI with threading
[warning] ofThread: - name: Thread 1 - Calling startThread with verbose is deprecated.
This problem still persists, and there is a simple solution aswell!
It’s a simple fix in main.cpp. Tested on Mac w/ XCode, OF 0.9.3
File: src/main.cpp
#include "ofMain.h"
#include "testApp.h"
int main( ){
ofSetupOpenGL(640*2,500*2,OF_WINDOW); // <-------- setup the GL context
//ofSetupOpenGL(&window, 640*2,480*2, OF_WINDOW); // <-------- setup the GL context
// this kicks off the running of my app
// can be OF_WINDOW or OF_FULLSCREEN
// pass in width and height too:
ofRunApp(new testApp());
}
About the deprication of Poco, I read up on some posts by arturo and managed to get ofxOpenNi working without the need for Poco::mutex. The example file runs fine with the latest Openframeworks nightlies.