Search code examples
visual-c++visual-studio-2015openniorbbec

Orbbec and OpenNi2: DeviceOpen using default: no devices found


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;
}

Solution

  • 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...