Feb 21, 2011

Kinect with Processing on Ubuntu Linux

At last it seems to work!


We have been trying to make Kinect accessible from Processing with the help of OpenKinect's Java JNI Wrapper tutorial, Nikolaus Gradwohl's tutorial and some hints at this thread.








UPDATED 2nd June 2011: Just in case, here is the compiled processing openkinect library , and here the modified source and build file of Shiffman's wrapper for Ubuntu Lucid 10.04, 2.6.32-28 (tested with java-6-sun-1.6.0.24 and OpenKinect-libfreenect-4a159f8).

11 comments:

  1. I'm getting an error message "The package "org.openkinect.processing" does not exist. You might be missing a library." It appears it's having issues with the import org.openkinect.processing.* line. I'm not entirely familiar with Java, but I think my problem is that the "processing" directory is not being included in the openkinect.jar compile but I don't see anyone mentioning how to do this.

    Do you know how to correct this? I am positive I have the openkinect.jar in the correct sketchbook library location.

    ReplyDelete
  2. Hi!

    I had some of that error too. I'll have to review the steps to see exactly how it was solved.
    There was a thing about the access rights to the usb bus files of the kinect that was also messy.
    I'll check everything again and tell you more.

    ReplyDelete
  3. Can you please try with this version?

    http://www.4shared.com/file/A6kUeMFz/openkinect_ubuntu_processing_a.html

    I found that in my test I keeped the openkinect.jar released for the OSX library (renamed to "openkinect.kinect.jar") inside the sketchbook/libraries/openkinect/library folder, toghether with the openkinct.jar I compiled with ubuntu. With both files processing finds everything and is happier.

    The problem is that the examples refer to daniel shiffman's version of the wrapper (for OSX), which includes the package "org.openkinect.processing" with a class named kinect.

    I'll try to compile everything again in a single library file.

    ReplyDelete
  4. UPDATE:

    I merged the contents of Daniel Shiffman's /processing classes in his .jar with the ones in the original OpenKinect.jar compiled in linux. The links above are updated so the library should work fine now.

    ReplyDelete
  5. With the las freenect java wrapper the IR image is enabled but the performance drops a lot, even in RGB mode. Here is the sample library:

    http://www.4shared.com/file/GBSVkl-Q/openkinect_slow_but_IR_enabled.html

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. David!

    I appreciate all your updates but unfortunately I'm still having the "UnsatisfiedLinkError: no kinect in java.library.path". I had it working for awhile on Ubuntu 10.10 and then out of the blue it stopped working. I've now installed Ubuntu 10.04 32-bit and tried using your libraries but I get the same "UnsatisfiedLinkError".

    I know I have my build.sh looking very similar to what your's looked like and I don't get any errors once I run the script. Any idea why my libOpenKinect.so is screwing up? What files are you transferring over to the sketchbook/libraries/openkinect/library.

    Thanks David! Huge help. Hope I get this working soon.

    ReplyDelete
  8. @The Poly Ninja

    Hi, sorry for the late answer, did you try the last version I uploaded?

    Regards

    ReplyDelete
  9. I've just updated the library to make it work with the latest OpenKinect image from the official branch. Had to make a few changes to Shiffman's code and JNI.

    Here is the new compiled library:

    http://www.4shared.com/file/hBAxxv3m/processing_OpenKinect-libfreen.html

    And here the modified wrapper source and build.sh files:
    http://www.4shared.com/file/_b04fVFO/processing_OpenKinect-libfreen.html

    ReplyDelete
  10. Great job!
    Do you know any high level API working with OpenKinect?
    I'm searching for a skeleton tracking algorithm to use in processing but it's too hard to find...

    ReplyDelete
  11. Thanks!

    Buth thank also Daniel Shiffman (www.shiffman.net) for developing the original wrapper.

    We have been experimenting with oF, OpenNI and the Primesense skeleton tracking with success. See this post: http://therandomlab.blogspot.com/2011/03/kinect-openni-niteskeleton-with.html

    Also in our latest post, we show a practical case of using OSCeleton to capture the data and send it via OSC to any client application:
    http://therandomlab.blogspot.com/2011/07/malotas-interactive-puppets.html

    You may receive this OSC data with processing. See an example here: http://urbanhonking.com/ideasfordozens/2011/02/16/skeleton-tracking-with-kinect-and-processing/

    ReplyDelete