Kinect install instructions

From Tekkotsu Wiki

Jump to: navigation, search

Contents

Kinect Setup for Tekkotsu

1. Install required packages:

sudo -s
apt-get -y install g++ git-core python libusb-1.0-0-dev freeglut3-dev doxygen
apt-get -y install libmono-winforms*

2. Install OpenNI driver: as of 8/1/2011 we're using the unstable version.

cd /opt
git clone https://github.com/OpenNI/OpenNI.git
cd OpenNI
git checkout unstable
cd Platform/Linux/CreateRedist
./RedistMaker
cd ../Redist/OpenNI*
./install.sh

3. Install Sensor package from avin2:

cd /opt
git clone https://github.com/avin2/SensorKinect
cd SensorKinect/Platform/Linux/CreateRedist
./RedistMaker
cd ../Redist/Sensor*
./install.sh

Once the above steps are completed, recompiling Tekkotsu will enable Kinect support. Additional steps:

4. Add udev rules to fix device protections. You can skip this step if you have the standard Tekkotsu Linux Udev Rules installed.

cat << EOF >> /etc/udev/rules.d/51-kinect.rules
# ATTR{product}=="Xbox NUI Motor"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02b0", MODE="0666"
# ATTR{product}=="Xbox NUI Audio"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02ad", MODE="0666"
# ATTR{product}=="Xbox NUI Camera"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02ae", MODE="0666"
EOF

5. Remove the gspca_kinect driver, which blocks OpenNI access to the Kinect:

echo "blacklist gspca_kinect" > /etc/modprobe.d/blacklist-kinect.conf
rmmod gspca_kinect

6. Try an OpenNI demo (plug in the Kinect first):

cd /opt/OpenNI/Platform/Linux/Bin/*Release
./NiViewer

7. Add new users to the video group to give them device access. (Note: on Tekkotsu robots,'user' is already a member of the video group. So you only need to do this step if you have created additional users.)

adduser <username> video

Other Kinect Resources

libfreenect

libfreenect from OpenKinect.org is an open source Kinect package with a nice demo called glcview. To install it and run the demo, do:

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

ROS openni_kinect

ROS includes an openni_kinect stack based on the OpenNI driver for Kinect.