none
Skeleton Tracking with 4 kinects RRS feed

  • Question

  • Hello,

    i'm working on a project that needs to track a human body with a 360° freedom, so i decided to use 4 kinects.

    Initially i started with the Beta2 SDK using 4 kinects with a switch system (with a PC with 4 different USB controllers) , so i used to kill the kinect instance which is tracking and then create another one for the kinect i need to perform the skeleton tracking. 

    Now i'm using the SDK 1.0, and seems that the instance cannot be killed.

    More specifically, on the init of my application i create the instance of the first kinect using NuiCreateSensorById passing the ID of the kinect i really need for the first boot. Then use NuiInitialize(NUI_INITIALIZE_FLAG_USES_SKELETON).

    After that it start tracking normally and do my stuffs correctly.

    When i need to switch to another kinect, i follow these steps :

    //INuiSensor* _kinect;  defined in my *.h file
    
    _kinect->NuiSkeletonTrackingDisable();
         	//(on the current kinect) 
    
    _kinect->Release();					   
            //(on the current kinect)
    
    HRESULT hr = _kinect->NuiCreateSensorById(L"ID_",_kinect);
            //(with the ID of the new kinect i need)
    
    //at this point i get S_OK from his HRESULT
    
    _kinect->NuiInitialize(NUI_INITIALIZE_FLAG_USES_SKELETON);	        //(on the new kinect)
    
    _kinect->NuiSkeletonTrackingEnable(_hanler,0);

    The problme is that after the 

    _kinect->NuiInitialize(NUI_INITIALIZE_FLAG_USES_SKELETON);

    on the new kinect it starts a loop and never return, but i can't understand why!

    Previously with the old Beta2 these steps for my kinect switch works well! ( i upgraded to 1.0 because in Beta2, the DLL never terminate).

    Can someone help me please? 

    Really thanks,

    regads

    FOX_ITA

     


    • Edited by FOX_ITA Tuesday, March 13, 2012 10:57 AM
    Tuesday, March 13, 2012 10:55 AM

All replies

  • There is a known problem in the V1.0 SDK when making multiple calls to NuiInitialize. The release notes provide a workaround:

    If C++ code is executing NuiInitialize/NuiShutdown multiple times through the application’s lifetime, SetDeviceStatusCallback should be called once, before invoking those calls.

    Also, I'd also recommend calling NuiShutdown before releasing your first sensor, to ensure that it releases its lock on the skeleton tracker. Otherwise, your subsequent call to NuiInitialize on another sensor may fail with E_NUI_SKELETAL_ENGINE_BUSY.

    John
    K4W Dev

    Tuesday, March 13, 2012 5:55 PM