Monday, April 23, 2012

Installing Kinect Drivers



There are a lot of resources out there to install open source drivers for the Kinect. We decided to go with libfreenect for its simplicity and ease of installation. It also comes with a few demo programs that are helpful in verifying that everything is installed correctly, and as a reference for integrating the kinect into your own software. Copy and paste installation instructions are:

sudo apt-get install git-core cmake libglut3-dev pkg-config build-essential libxmu-dev libxi-dev libusb-1.0-0-dev
git clone git://github.com/OpenKinect/libfreenect.git
cd libfreenect
mkdir build
cd build
cmake ..
make
sudo make install
sudo ldconfig /usr/local/lib64/
sudo glview

The last command opens a window that views the RGB and depth streams from the kinect. This fails if you are not running a GUI, so something like Tilt demo or Record is sufficient for quick testing.



Now, if you want to actually see the kinect on the beagleboard it requires installing either gnome or lxde. We installed lxde at first to check and see that everything was working, but haven't used it since. There was honestly no point to installing it, but in case you want to know how...

Gnome:
sudo apt-get install xfce4 gdm xubuntu-gdm-theme xubuntu-artwork
LXDE:
sudo apt-get install lxde



After restarting, the interface should be visible on a directly connected monitor. This is not advised though, because it slows the system down quite a bit.

We also installed a number of other packages, some of which we won't get the opportunity to use (like ARToolKitPlus) because of time constraints.

Some essentials:
sudo apt-get install build-essential libavformat-dev ffmpeg

These packages make the core of our streaming program, and ffmpeg is relatively easy to use.

For ARToolKitPlus:
wget http://launchpad.net/artoolkitplus/trunk/2.2.1/+download/ARToolKitPlus-2.2.1.tar.bz2
cd Desktop/ARToolKitPlus
mkdir build
cd build cmake .. make
sudo make install


Also, order to access all of the kinect drivers you need to set up the permissions to either access through root, or enable it to be used by a specific user. This is done through the file located in,
/etc/udev/rules.d/66-kinect.rules

Copy and paste this into the file:
#Rules for Kinect ###################################################### SYSFS{idVendor}=="045e", SYSFS{idProduct}=="02ae", MODE="0660",GROUP="video" SYSFS{idVendor}=="045e", SYSFS{idProduct}=="02ad", MODE="0660",GROUP="video" SYSFS{idVendor}=="045e", SYSFS{idProduct}=="02b0", MODE="0660",GROUP="video" ### END #############################################################

Then,
sudo adduser ubuntu video

Once all of this is done (and packages have been installed to your liking) you can begin to hack the kinect to fit the needs of your project!

Adapted from these sources:
http://openkinect.org/wiki/Getting_Started#Ubuntu_Manual_Install
http://www.ecse.monash.edu.au/twiki/bin/view/WSRNLab/BeagleBoardConfigurationForKinect

No comments:

Post a Comment