Question

I have tried just about everything for getting the Kinect for Windows to actually produce an image. I have downloaded Daniel Shiffman's Openkinect library and I have installed it as instructed, yet I get the message that no kinect devices are installed. I took a look at the system profiler in Lion and I have the Camera and the Kinect Audio information available. Still, I have no success. I am running Processing with the RGBDepth example and I get a nullpointerexception every time I try to enable the depth image, RGB image, or IR image. I am thinking that because the program cannot 'see' the Kinect, the image returns null and the exception occurs. What can I do to have the Kinect 'seen' by my laptop?

Also, before you say to plug in the 12V DC adapter or switch the USB port, I have already done so.

Running on a Macbook Pro OSX Lion late 2011

Was it helpful?

Solution

EDIT 2: Working code: This branch already contains a subset of the changes I was making, and actually runs. It's unstable, but at least you can get a depth and color image. https://github.com/zarvox/libfreenect/tree/k4w-wip

The instability is due to isochronous transfers in libusb on Darwin. The patch that comes with libfreenect just makes libusb less unstable.



Kinect for Windows isn't supported in the main tree. Have you tried this patch? https://github.com/renewagner/libfreenect/tree/k4w-wip

Edit: This repository is too old for the firmware version that I (we) have.

To detect the camera, you only need to change usb_libusb10.c in three places, where it checks desc.idProduct == PID_NUI_CAMERA. This must now be

(desc.idProduct == PID_NUI_CAMERA || desc.idProduct == PID_NUI_CAMERA_K4W);

And add:

#define PID_NUI_CAMERA_K4W 0x02bf

Also remember that the Kinect for Windows does not have a motor. You may need to modify source that assumes it exists.

This is still insufficient, however. The USB commands have also changed.

In cameras.c,

static int freenect_fetch_zero_plane_info(freenect_device *dev)
{
    freenect_context *ctx = dev->parent;

    char reply[0x200];
    uint16_t cmd[5] = {0}; // Offset is the only field in this command, and it's 0
    // Different reply based on hardware
    const int expected_reply_length = dev->kinect_for_windows ? 334 : 322;
    int res;
    res = send_cmd(dev, 0x04, cmd, 10, reply, expected_reply_length); //OPCODE_GET_FIXED_PARAMS = 4,
    if (res != expected_reply_length) {
        FN_ERROR("freenect_fetch_zero_plane_info: send_cmd read %d bytes (expected %d)\n", res, expected_reply_length);
        return -1;
    }

Note that I added a field to freenect_device to store if it's a Kinect for Windows.

It's still not streaming data, but this is as far as I've gotten.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top