2

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

  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

4

3 回答 3

2

我添加此答案是因为@Brian Tompsett 的链接已损坏。在编译 libfreenect 时有一个简单的解决方法:只需确保在构建期间-DBUILD_OPENNI2_DRIVER=ON调用时打开标志。cmakelibfreenect's

安装后,前往

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

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

通过测试预编译的NiViewer. 根据您在 udev 文件夹中配置的规则,您可能需要NiViewer使用 root 运行。

祝你好运!

于 2015-07-26T19:55:41.910 回答
1

(由 OP 在编辑中回答,请参阅没有答案的问题,但问题已在评论中解决(或在聊天中扩展)

OP写道:

根据OpenNI 论坛主题

新的 OpenNI SDK2 不支持 Kinect 设备。无论如何,有一个链接到 OpenKinect 驱动程序“被黑”以使用 OpenNI SDK2

于 2015-01-26T16:52:12.640 回答
1

@Calorified 的回答对我有用。

此外,确保更新OpenNI.ini文件,例如运行 OpenNI 示例应用程序OpenNI2/Samples/Bin或 NiTE 示例应用程序/path/to/NiTE*/Samples/Bin

例如,我使用的是 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
    

你必须对 NiTE 样本做同样的事情。示例现在应该运行。

不更新OpenNI.ini我总是得到错误DeviceOpen using default: no devices found

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

于 2016-04-05T04:40:31.570 回答