Вопрос

I downloaded OpenNI SDK2 sources x64, compiled and tried to run Samples, but wasnt successful.

  100 INFO       New log started on 2013-10-27 00:03:47
  130 INFO       --- Filter Info --- Minimum Severity: VERBOSE
  166 VERBOSE    No override device in configuration file
  182 VERBOSE    Configuration has been read from './OpenNI.ini'
  190 VERBOSE    OpenNI 2.2.0 (Build 32)-Linux-x86 (Oct 26 2013 21:13:04)
  197 VERBOSE    Using './OpenNI2/Drivers' as driver path
  208 VERBOSE    Looking for drivers in drivers repository './OpenNI2/Drivers'
  933 INFO       New log started on 2013-10-27 00:03:47
  950 INFO       --- Filter Info --- Minimum Severity: VERBOSE
  966 VERBOSE    Initializing USB...
 1074 INFO       USB is initialized.
 4274 INFO       New log started on 2013-10-27 00:03:47
 4292 INFO       --- Filter Info --- Minimum Severity: VERBOSE
 4304 VERBOSE    Initializing USB...
 4366 INFO       USB is initialized.

15321 VERBOSE    Trying to open device by URI '(NULL)'
15367 ERROR      Can't open default device - none found
Couldn't open device
DeviceOpen using default: no devices found

lsusb gets this

Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 058f:b002 Alcor Micro Corp. 
Bus 001 Device 004: ID 045e:00f0 Microsoft Corp. 
Bus 002 Device 003: ID 046d:c312 Logitech, Inc. DeLuxe 250 Keyboard
Bus 002 Device 007: ID 0409:005a NEC Corp. HighSpeed Hub
Bus 002 Device 004: ID 1c7a:0603 LighTuning Technology Inc. 
Bus 002 Device 009: ID 045e:02ad Microsoft Corp. Xbox NUI Audio
Bus 002 Device 008: ID 045e:02b0 Microsoft Corp. Xbox NUI Motor
Bus 002 Device 010: ID 045e:02ae Microsoft Corp. Xbox NUI Camera

I also tried some libfreenect examples with kinect a it worked without any problem.

I add some line to SimpleRead main.cpp file

Array<DeviceInfo> dev_info;
OpenNI::enumerateDevices(&dev_info);
printf("Number of devices %d \n",dev_info.getSize());

which writes out 0.

Output of lsmod | grep gspca_kinect is void

What could be possibly wrong?

I'm on Ubuntu 64bit v13.04, Kinect is "Kinect for Xbox", using USB2

Это было полезно?

Решение 2

(Answered by the OP in an edit, see Question with no answers, but issue solved in the comments (or extended in chat) )

The OP wrote:

According to OpenNI forum topic

new OpenNI SDK2 doesnt support Kinect device. Anyway, there is a link to OpenKinect drivers "hacked" to work with OpenNI SDK2

Другие советы

I am adding this answer because @Brian Tompsett's link is broken. There is an easy workaround to this while compiling libfreenect: just ensure you turn on the flag -DBUILD_OPENNI2_DRIVER=ON when calling cmake during libfreenect's build.

After installing, head over to

/home/$(whoami)/path/to/libfreenect/build/lib/OpenNI2-FreenectDriver

and copy libFreenectDriver.so* to your downloaded OpenNI2 Bin directory, i.e.: /path/to/OpenNI2/Bin/x64-Release/

Check if your installation is okay by testing the precompiled NiViewer. Depending on the rules you configured in your udev folder, you might need to run NiViewer with root.

Good luck!

@Calorified 's answer worked for me.

In addition, make sure to update the OpenNI.ini file, e.g. to run the OpenNI sample apps in OpenNI2/Samples/Bin or the NiTE sample apps in /path/to/NiTE*/Samples/Bin.

For example, I was using the 32-bit OpenNI version 2.2:

  1. I copied the libFreenectDriver.so* to /path/to/OpenNI2/Tools (there is no bin/x64-release folder in this OpenNI version).
  2. In OpenNI2/Samples/Bin, edit the file OpenNI.ini
  3. Under the [Drivers] section, at the end of the file, add the line: Repository=/path/to/OpenNI2/Tools (where you put the libFreenectDriver.so file). Below is my edited OpenNI.ini file. I used a relative path, but an absolute path will also work.

    #/path/to/OpenNI2/Samples/Bin/OpenNI.ini
    [Log]
    ; 0 - Verbose; 1 - Info; 2 - Warning; 3 - Error. Default - None
    Verbosity=3
    LogToConsole=0
    LogToFile=0
    
    [Device]
    ;Override=""
    
    [Drivers]
    ; Location of the drivers specified by a relative path based on  OpenNI's shared library or an absolute path.
    ; Path separator "/" can be used to be portable for any platforms.
    ; Default - OpenNI2/Drivers
    Repository=../../Tools
    

You'll have to do the same thing for the NiTE samples. The samples should run now.

Without updating the OpenNI.ini I always get the error DeviceOpen using default: no devices found

*ps. libfreenect installation will put the libFreenectDriver.so in /usr/local/lib/OpenNI2-FreenectDriver/

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top