How can I access the Kinect/device via OpenNI?

别等时光非礼了梦想. 提交于 2019-11-29 12:15:34

The standard OpenNI Kinect drivers don't expose or allow access to any accelerometer, motor, or LED controls. All of these controls are done through the "NUI Motor" USB device (protocol reference), which the SensorKinect Kinect driver doesn't communicate with.

One way around this is to use a modified OpenNI SensorKinect driver, i.e., this one which does connect to the NUI Motor device, and exposes basic accelerometer and motor control via a "CameraAngleVertical" integer property. It appears that you should be able to read/write an arbitrary integer property using SimpleOpenNI and Processing.

If you're willing to use a non-OpenNI-based solution, you can use Daniel Shiffman's Kinect Processing library which is based on libfreenect. You'll get good accelerometer, motor, etc..., but will lose access to the OpenNI skeleton/gesture support. A similar library for OpenFrameworks is ofxKinect.

Regarding locking of OpenNI nodes, my understanding is that this just prevents properties from updating and does nothing at the USB driver level. Switching between drivers--PrimeSense-based SensorKinect and libusb-based libfreenect--at runtime is not possible. It may be possible (I haven't tried it) to configure OpenNI for the camera device, and to use freenect to communicate with the NUI Motor device. No locking/synchronization between these devices should be required.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!