Orbbec and OpenNi2: DeviceOpen using default: no devices found

4.2k Views Asked by At

I have got an Orbbec Astra depth sensor attached via USB and the device manager shows the driver is correctly installed.

I have downloaded the "Astra & OpenNI2" bundle from orbbec.com but have only installed the SensorDriver_V4.3.0.4.exe and the OpenNI2 package seperatly which I have downloaded from structure.io.

I have got the following code, which compiles just fine. But when running it returns Device open failed: DeviceOpen using default: no devices found.

The same happens when running NiViewer.exe What am I doing wrong here? Is there some additional driver needed?

#include "stdafx.h"
#include <OpenNI.h>

int main()
{
    openni::Status rc = openni::STATUS_OK;
    openni::Device device;
    openni::VideoStream depth, color;

    const char* deviceURI = openni::ANY_DEVICE;

    rc = openni::OpenNI::initialize(); 

    printf("After initialization:\n%s\n", openni::OpenNI::getExtendedError());

    rc = device.open(deviceURI); 

    if (rc != openni::STATUS_OK)
    {
        printf("Device open failed: %s\n", openni::OpenNI::getExtendedError());
        openni::OpenNI::shutdown();
        return 1;
    }

    return 0;
}
2

There are 2 best solutions below

0
On BEST ANSWER

I "solved" the issue by uninstalling the OpenNI2 package that I have downloaded from structure.io and used the OpenNI2 files that came with the Orbbec driver.

Still no clue why I can't use the plain vanilla OpenNI2 packages...

1
On

you just needed to copy the 3 files (provided in the zip custom OpenNI 2.3 from ORBBEC) in your already installed OPENNI2 2.2 SDK folder structure ( similar to zzzz\OpenNI2\Drivers :

  • xxxx\OpenNI2\Drivers\orbbec.ini xxxx\OpenNI2\Drivers\orbbec.lib xxxx\OpenNI2\Drivers\orbbec.dll

Basically doing this, you are extending the number of OPENNI2 managed camera by adding a "driver". Current default install folder contains the following already :

  • Kinect.dll, Onifile.dll, PS1080.ini PS1080.lib PS1080.dll PSLink.ini PSLink.lib PSLink.dll

(so add the 3 orbbec files there)

Important: if you launch niviewer.exe from command line, it will search for a relative subfolder \OpenNI2\drivers subfolder first (so update this one in this case), or otherwise will look for this sub folder inside the default installation environment parameter (OPENNI2_REDIST or OPENNI2_REDIST64) depending on your installation. So take care ! Hope it helps.