How To: Build OpenKinect/LibFreenect in Linux

The Kinect just came out in Australia today, so I’m already a little bit late to the party, but I’m keen to see what I can do with it so I went and picked one up earlier – a couple of minutes after unboxing and it’s happily working with Linux. Awesome =D

The GLView example running on LibFreenect
The GLView example running on LibFreenect

Anyways, here’s what you need to do to build the library for yourself:

  1. Using synaptic or apt-get, install the following packages: libusb1.0-dev, freeglut3-dev, git, cmake
  2. It’s possible you may need to install some other packages as well depending on what you currently have or don’t have installed, but if you need anything additional then cmake will let you know about it when you get to that step.

  3. Download the libFreenect source code using git (this will make a directory for you called libfreenect):

  4. Make a directory inside the c folder where you’ve downloaded the libFreenect source code and use cmake to configure the build:

  5. Actually compile the library:

That’s it – you’re done!

Now you can check out what the kinect’s seeing by going into the examples directory (which will now exist at ~/libfreenect/build/examples) and running ./glview as root:

I think we’re going to have a lot of fun with this… =D