OpenNI SDK2,找不到Kinect设备(Ubuntu 13.04)

时间:2013-10-26 22:42:37

标签: kinect openni ubuntu-13.04

我下载了OpenNI SDK2源x64,编译并尝试运行Samples,但没有成功。

  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得到了这个

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

我还尝试了一些带有kinect的 libfreenect 示例,它没有任何问题。

我在SimpleRead main.cpp文件中添加了一些行

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

写出0。

输出 lsmod | grep gspca_kinect 无效

可能出现什么问题?

我在Ubuntu 64bit v13.04上,Kinect是“Kinect for Xbox”,使用USB2

3 个答案:

答案 0 :(得分:2)

我正在添加这个答案,因为@Brian Tompsett的链接已被破坏。在编译libfreenect时有一个简单的解决方法:确保在-DBUILD_OPENNI2_DRIVER=ON构建期间调用cmake时打开标记libfreenect's

安装完毕后,请转到

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

并将libFreenectDriver.so*复制到您下载的OpenNI2 Bin目录,即:/path/to/OpenNI2/Bin/x64-Release/

通过测试预编译的NiViewer来检查您的安装是否正常。根据您在udev文件夹中配置的规则,您可能需要以root身份运行NiViewer

祝你好运!

答案 1 :(得分:1)

(OP在编辑中回答,请参阅Question with no answers, but issue solved in the comments (or extended in chat)

OP写道:

  

根据OpenNI forum topic

     

新的OpenNI SDK2不支持Kinect设备。无论如何,有一个link到OpenKinect的驱动程序&#34; hacked&#34;使用OpenNI SDK2

答案 2 :(得分:1)

@Calorified的答案对我有用。

此外,请务必更新OpenNI.ini文件,例如在OpenNI2/Samples/Bin中运行OpenNI示例应用程序或在/path/to/NiTE*/Samples/Bin中运行NiTE示例应用程序。

例如,我使用的是32位OpenNI版本2.2:

  1. 我将libFreenectDriver.so*复制到/path/to/OpenNI2/Tools(此OpenNI版本中没有bin/x64-release文件夹。)
  2. OpenNI2/Samples/Bin中,修改文件OpenNI.ini
  3. [Drivers]部分的文件末尾添加以下行:Repository=/path/to/OpenNI2/Tools(放置libFreenectDriver.so文件的位置)。下面是我编辑的OpenNI.ini文件。我使用了相对路径,但绝对路径也可以使用。

    #/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
    
  4. 您必须为NiTE样品做同样的事情。样品现在应该运行。

    在不更新OpenNI.ini的情况下,我总是收到错误DeviceOpen using default: no devices found

    * PS。 libfreenect安装会将libFreenectDriver.so放入/usr/local/lib/OpenNI2-FreenectDriver/