Developing apps for the Raspberry Pi that utilize the Xbox 360 Kinect is best accomplished with libfreenect. Libfreenect is an open-source library that provides access to the sensors and motors on the Kinect.
Raspbian’s apt repository has version 0.2 of libfreenect, which is quite old and seems to be missing a lot of the features that the latest code has. I’ve documented the steps for building the latest LibFreenect source code and dependencies, below (0.5.3 as of this post).
Libfreenect v0.2 seems to have a fairly incomplete set of sample apps (at least compared to version v0.5.3). I’m not sure if this is an indicator that the library itself is missing many of the features, but the samples in v0.5.3 do a far better job of showcasing the capabilities of the Kinect.
I’m using the Raspberry Pi 2B with Raspbian Jessie, but these steps will likely work with other versions.
Step 1: Update Sources
To get started, open a shell in Raspian and update your sources and installed apps:
sudo apt-get update
sudo apt-get upgrade
Step 2: Install prerequisites for libusb and libfreenect
Now make sure you have the necessary core apps and libraries that we’ll need to build libfreenect and libusb.
Note, do not install libusb from the apt repository, we will need to build the latest version in the next step.
sudo apt-get install cmake libudev0 libudev-dev freeglut3 freeglut3-dev libxmu6 libxmu-dev libxi6 libxi-dev
Step 3: Download and build libusb
Next we will build libusb, which is required by libfreenect. You may want to change the download URL to the latest version. As of this post, v1.0.20 was the latest. You can find the libusb releases here.
tar -jxf libusb-1.0.20.tar.bz2
sudo make install
Step 4: Download and build libfreenect
And finally, let’s download and build libfreenect. I suggest checking for the latest version. Below I have steps for v0.5.3, but you can check for a newer version at the libfreenect Github page.
tar -xvzf v0.5.3.tar.gz
cmake -L ..
sudo make install
If everything goes well, you should see several sample apps in /usr/local/bin/ (starting with “freenect-” and “fakenect-“):