ofxOpenNI getNumTrackedUsers return 0

Hi. I’m a beginner of ofxOpenNI programing.
I created simple example under this enviroment.

===========

• Mac OSX 10.9
• Xcode 5.0.2
• OF 0.8.0
• Kinect XBOX 360
https://github.com/gameoverhack/ofxOpenNI (master branch)

#include "testApp.h"

//--------------------------------------------------------------
void testApp::setup(){
    
    kinect.setup();
    
    kinect.addImageGenerator();
    kinect.addDepthGenerator();
    kinect.addUserGenerator();
    kinect.setMaxNumUsers(2);
    kinect.setUseMaskTextureAllUsers(true);
    
    kinect.start();
}

//--------------------------------------------------------------
void testApp::update(){
    kinect.update();
}

//--------------------------------------------------------------
void testApp::draw(){
    ofSetColor(255, 255, 255);
    kinect.drawDebug();

}

===========

I got image drawing and dpeth drawing but only skeleton tracking didn’t work.
I konw I have to pose to track user and I tried a lot of times, but the function of getNumTrackedUsers in OfxOpenNI.cpp always returned 0.

I saw previous topics about this issue, but I couldn’t found how to resolve it.
Please excuese me my bad English and mentioning OF advanced following users without consideration.

@roymacdonald
@gameover

Thanks.

I got more information about this topics.
The log OF_LOG_VERBOSE dumped following.

[warning] ofxOpenNIDevice[0]: Using a NASTY hack to silence SIGNAL errors on exit - read the comments at line ~1712 of ofxOpenNI.cpp
[notice ] ofxOpenNIDevice[0]: Init context...
[verbose] ofxOpenNIDevice[0]: Context initilizedstatus:OK
[notice ] ofxOpenNIDevice[0]: openni driver version: 1.5.2.7
[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:OK
[notice ] ofxOpenNIDevice[0]: Adding generator typeXN_NODE_TYPE_IMAGE
[verbose] ofxOpenNIDevice[0]: Creating XN_NODE_TYPE_IMAGE generatorstatus:OK
[verbose] ofxOpenNIDevice[0]: Setting Image1 resolution: 640 x 480 at 30fpsstatus:OK
[verbose] ofxOpenNIDevice[0]: Starting XN_NODE_TYPE_IMAGE generatorstatus:OK
[verbose] ofxOpenNIDevice[0]: Allocating image
[notice ] ofxOpenNIDevice[0]: Adding generator typeXN_NODE_TYPE_DEPTH
[verbose] ofxOpenNIDevice[0]: Creating XN_NODE_TYPE_DEPTH generatorstatus:OK
[verbose] ofxOpenNIDevice[0]: Setting Depth1 resolution: 640 x 480 at 30fpsstatus:OK
[verbose] ofxOpenNIDevice[0]: Starting XN_NODE_TYPE_DEPTH generatorstatus:OK
[verbose] ofxOpenNIDevice[0]: Allocating depth
[notice ] ofxOpenNIDevice[0]: Adding generator typeXN_NODE_TYPE_USER
[verbose] ofxOpenNIDevice[0]: Creating XN_NODE_TYPE_USER generatorstatus:Can't create any node of the requested type!
[verbose] ofxOpenNIDevice[0]: Starting XN_NODE_TYPE_USER generatorstatus:Can't create any node of the requested type!
[notice ] ofxOpenNIDevice[0]: Starting ofxOpenNI with threading

Is this the problem of NITE, isn’t it??
The part of directory tree of this project is following.

[

mamoru-no-MacBook-Pro|include]$ pwd
/Users/mamoru/AppleTon/of_v0.8.0_osx_release/apps/Protype/kinectOscSender/include

[mamoru-no-MacBook-Pro|include]$ tree
.
├── libusb
│   └── libusb.h
├── nite
│   ├── XnCommon.h
│   ├── XnV3DVector.h
│   ├── XnVActivationMessage.h
│   ├── XnVBroadcaster.h
│   ├── XnVCCMessage.h
│   ├── XnVCircle.h
│   ├── XnVCircleDetector.h
│   ├── XnVClickableVirtualPlane.h
│   ├── XnVComplexMessage.h
│   ├── XnVDepthControl.h
│   ├── XnVDepthGenerator.h
    ├── XnInternalDefs.h
    ├── XnLicensing.h
    ├── XnList.h
    ├── XnLog.h
    ├── XnLogTypes.h
    ├── XnLogWriterBase.h
    ├── XnMacros.h
    ├── XnModuleCFunctions.h
    ├── XnModuleCppInterface.h
    ├── XnModuleCppRegistratration.h
    ├── XnModuleInterface.h
    ├── XnNode.h
    ├── XnNodeAllocator.h
    ├── XnOS.h
    ├── XnOSCpp.h
    ├── XnOSMemory.h
    ├── XnOSStrings.h
    ├── XnOpenNI.h
    ├── XnPlatform.h
    ├── XnPrdNode.h
    ├── XnPrdNodeInfo.h
    ├── XnPrdNodeInfoList.h
    ├── XnProfiling.h
    ├── XnPropNames.h
    ├── XnQueries.h
    ├── XnQueue.h
    ├── XnScheduler.h
    ├── XnStack.h
    ├── XnStatus.h
    ├── XnStatusCodes.h
    ├── XnStatusRegister.h
    ├── XnStringsHash.h
    ├── XnThreadSafeQueue.h
    ├── XnTypes.h
    ├── XnUSB.h
    ├── XnUSBDevice.h
    ├── XnUtils.h
    └── XnVersion.h

[mamoru-no-MacBook-Pro|openni]$ pwd
/Users/mamoru/AppleTon/of_v0.8.0_osx_release/apps/Protype/kinectOscSender/bin/data/openni

[mamoru-no-MacBook-Pro|openni]$ tree
.
├── config
│   ├── FeatureExtraction.ini
│   ├── GlobalDefaults.ini
│   ├── GlobalDefaultsKinect.ini
│   ├── Nite.ini
│   ├── SamplesConfig.xml
│   ├── h.dat
│   ├── licenses.xml
│   ├── modules.xml
│   ├── ofxopenni_config.xml
│   └── s.dat
└── lib
    ├── change_exec_paths.sh
    ├── libOpenNI.dylib
    ├── libXnCore.dylib
    ├── libXnDDK.dylib
    ├── libXnDeviceFile.dylib
    ├── libXnDeviceSensorV2KM.dylib
    ├── libXnFormats.dylib
    ├── libXnVCNITE_1_5_2.dylib
    ├── libXnVFeatures_1_5_2.dylib
    ├── libXnVHandGenerator_1_5_2.dylib
    ├── libXnVNite_1_5_2.dylib
    ├── libnimCodecs.dylib
    ├── libnimMockNodes.dylib
    ├── libnimRecorder.dylib
    └── libusb-1.0.0.dylib

In addtion, there is nite library in my local brew cellar because of woriking kinect on Processing.
(installed from https://github.com/totakke/homebrew-openni)

[mamoru-no-MacBook-Pro|~]$ ll /usr/local/Cellar/nite/
total 0
drwxr-xr-x  9 mamoru  admin  306 10 10 02:59 1.5.2.21

Best regards.

Hi,
Which versions of Nite and openNI are you using?
In the log you can see that there’s a problem creating the user generator.
Your code seems to be fine.
you must copy the openNI libs in the data folder of your app.
Also make sure you run the change_exec_paths.sh script.
BTW, you dont need to pose. Sjkeleton tracking works without it since several versions ago.
best!

Thank you for you quick reply, roymacdonald.

Ijust followed gameoverhack/ofxOpenNI installation (https://github.com/gameoverhack/ofxOpenNI),
so It seems to me that OpenNI libs already copied in my project.
(Copied from ofxOpenNI/mac/copy_to_data_openni_path)

[mamoru-no-MacBook-Pro|openni]$ pwd
/Users/mamoru/AppleTon/of_v0.8.0_osx_release/apps/Protype/kinectOscSender/bin/data/openni

[mamoru-no-MacBook-Pro|openni]$ tree
.
├── config
│   ├── FeatureExtraction.ini
│   ├── GlobalDefaults.ini
│   ├── GlobalDefaultsKinect.ini
│   ├── Nite.ini
│   ├── SamplesConfig.xml
│   ├── h.dat
│   ├── licenses.xml
│   ├── modules.xml
│   ├── ofxopenni_config.xml
│   └── s.dat
└── lib
    ├── change_exec_paths.sh
    ├── libOpenNI.dylib
    ├── libXnCore.dylib
    ├── libXnDDK.dylib
    ├── libXnDeviceFile.dylib
    ├── libXnDeviceSensorV2KM.dylib
    ├── libXnFormats.dylib
    ├── libXnVCNITE_1_5_2.dylib
    ├── libXnVFeatures_1_5_2.dylib
    ├── libXnVHandGenerator_1_5_2.dylib
    ├── libXnVNite_1_5_2.dylib
    ├── libnimCodecs.dylib
    ├── libnimMockNodes.dylib
    ├── libnimRecorder.dylib
    └── libusb-1.0.0.dylib

And how can I get Nite and openNi versions?
I thought gameoverhack/ofxOpenNI includes Nite and openNI library. Is this true??
Ijust confirmed NIte ver is 1_5_2( by the above directory tree) and openNI ver is 1.5.2.7(by log in the previous post).

Also ran change_exec_paths.sh but nothing happens…

Thanks.

This is weird. If you followed gameover’s instructions it should work right out of the box. I’d guess that your homebrew instalation of NITE might be bothering.
Do you have a different machine in which to try your compiled ofApp?

BTW, remember to change the base sdk in xcode to 10.8.

best

Thanks to you, It was fine on my in-house machine which spec is following.

=============
•Mac OSX 10.7.5
•Xcode 4.6.2

I guess this is Mac OS or Xcode ver problems because the App still didn’t work after I uninstalled homebrew NITE, OpenNI, Sensor-Kinect.
But I hope It will be fine on the my private machine !!!
Any ideas…?

Once I tried to install your repository(https://github.com/roymacdonald/ofxOpenNI) and gameover’s experimental branch but it happned some errors. Then I gave up.
Do you think if instalation of the other ofxOpenNI( means your repository or gameover’s experimental one) is successfule, It will be fine on the my private machine’s enviroment?

Regards.

HI,
About a ween ago a installed openNI on a brandnew macmini with osx 10.9 and xcode 5.0.2. It worked fine.

did you change your project’s SDK from 10.9 to 10.8 ?
As far as I can remember that was the only thing that I had to do.

best

Oh…
I have no idea to work fine on my pc.

I changed OS X Deployment Target and Base SDK( in the list of “Build Setting” > “Architectures”) from 10.9 to 10.8

Thanks.

HI, It has worked on fine!!!
I just cloned App created by another PC that is Mac OSX 10.7 and Xcode 4.6 by git repositories.

Maybe, It caused “bin/data/" files because it did’nt work again when I swaped all files under "bin/data/”.
My Installation before I asked you must have been bad…

I’ll try to hack kinect more!!
Thank you sooo much!!