January 6th, 2011

Getting started with the Kinect on OSX

The Kinect is a ridiculous piece of technology which is incredibly fun to play with and full of outstanding potential. All of the people working with the Kinect have done a fantastic job preparing libraries and making installation a relatively pain free process. Having said that, it can be a bit tricky connecting on a Mac if you don’t have much command line experience. Detailed below is my personal process.

The openkinect project is a great way to go. Great code base, and friendly help in the irc channel if it comes to that. For installation instructions, check out the page on their wiki. I’ve done this twice now, once with the MacPorts option detailed in the wiki, and once with Homebrew and self-patching libusb, and I have to say, MacPorts was infinitely easier.

You can grab the latest MacPorts right from their install page. Once you have that installed on your system, installing cmake and libusb is as easy as opening up Terminal and typing:

port install cmake

Easy! Note that if you are installing libusb through MacPorts as well, you want

port install libusb-devel

and not the regular libusb as the development version is prepatched. After this, it’s pretty straightforward to follow the wiki instructions, so I’ll try not to repeat too much information. I did, however, get hung up on a few small things.

First, make sure the Kinect is plugged in not only to your usb port, but also to a power outlet. When you plug in to your computer, the LED on the Kinect will come on, which seems to indicate that it is powered and working. Not so! If you’ve gotten the Kinect bundled with a system, then you probably don’t have the outlet plug and will need to buy it separately. I believe this is because the Kinect needs +12vdc to run, and your standard usb will only output +5.

Second, when you’re configuring the openKinect install, it asks you to run ccmake. There isn’t an extra ‘c’ there, ccmake is the Curses interface for cmake. This is just a small gui to help you configure the options cmake will use to build the project. Inside ccmake, you press C to configure, and you will get a lot of options filled in, all with asterisks next to them. At this point, press C again and a new option will appear that will allow you to generate a build options file, and the asterisks will disappear. Now you can press G to build the file, and you’re set. Don’t exit without creating this file, otherwise your build might not work correctly.

After following the instructions on the wiki, you should be ready to rock! I would highly recommend playing around with the openFrameworks examples. I believe Theo Watson wrote the initial wrapper, and it is really fantastic. You can check it out of his github repo here. If you are not that comfortable in C based languages, there are now wrappers for a ton of languages and platforms, including Cinder, Processing, and, yes, even ActionScript. Within a day of following others’ examples, it was pretty easy to get a point cloud exported, and then imported into a program like MeshLab. I can’t begin to fathom the possibilities, and I am eager to see what everyone comes up with.

Link dump!

Theo Watson on github

Memo on github – demos

Daniel Shiffman’s processing wrapper

Get inspired at CA!

If you find any I’ve missed, or have corrections, I’d love to see them added in the comments.

ch_pointcloudAbove: A point cloud exported from openframeworks into meshlab