Kinect, OpenNI, NiTE and Nuimotion Setup for Ubuntu


This is a follow up to my setup notes for OS X, here are my notes to setup Kinect, OpenNI, NiTE and Nuimotion on Ubuntu Desktop LTS 12.04 Precise.

– Installation notes for Ubuntu Desktop LTS 12.04 Precise.
NOTE: All code is installed to ~/Developer/Work

Install Updates

– Update system:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo reboot
sudo apt-get autoremove

Install freenect from github

– Install dependencies:

sudo apt-get install cmake libpthread-stubs0-dev libgl1-mesa-dev libx11-dev libxrandr-dev \
libfreetype6-dev libglew1.5-dev libjpeg8-dev libsndfile1-dev libopenal-dev freeglut3-dev \
libxmu-dev libxi-dev build-essential libusb-1.0-0-dev git git-core

– Clone `libfreenect`:

mkdir -p ~/Developer/Work
cd ~/Developer/Work
git clone
cd libfreenect
git checkout tags/v0.3.0

NOTE: Tested with libfreenect stable release v0.3.0

– Build and install:

cd  ~/Developer/Work/libfreenect
mkdir build
cd build
sudo make install

– Add to library path:

sudo vi /etc/
sudo ldconfig 

– Test with glview:

sudo glview

– Reference:

Install node.js

– Install `node.js` from source, this will take 10 min:

sudo apt-get install g++ curl libssl-dev apache2-utils
cd ~/Developer/Work
tar -xzf node-latest.tar.gz
cd node-v*
sudo make install

NOTE: Tested with node.js v0.10.23

Install OpenNI and NiTE

– Download OpenNI from:

– Uncompress OpenNI and move:

tar xvf OpenNI-Linux-x64-2.2.tar.bz2
mv OpenNI-Linux-x64-2.2 ~/Developer/Work/
cd ~/Developer/Work/OpenNI-Linux-x64-2.2
sudo ./

– Download NiTE from:

– Uncompress NiTE and move:

tar xvf NiTE-Linux-x64-2.2.tar.bz2
mv NiTE-Linux-x64-2.2 ~/Developer/Work/
cd ~/Developer/Work/NiTE-Linux-x64-2.2
sudo ./

– Copy `` to OpenNI2 directory:

cp /usr/local/lib64/OpenNI2-FreenectDriver/ \

– Copy all libraries to `/usr/local/lib`

sudo cp -R ~/Developer/Work/OpenNI-Linux-x64-2.2/Redist/* /usr/local/lib
sudo cp -R ~/Developer/Work/NiTE-Linux-x64-2.2/Redist/* /usr/local/lib

– Add to library path:

sudo vi /etc/
# Added
sudo ldconfig 

– Add OpenNI and NiTE to .bashrc:

cat ~/Developer/Work/OpenNI-Linux-x64-2.2/OpenNIDevEnvironment >> ~/.bashrc
cat ~/Developer/Work/NiTE-Linux-x64-2.2/NiTEDevEnvironment >> ~/.bashrc

– Logout and log back in to include changes made to `.bashrc`.

Install Nuimotion and Websocket

– Make project directory:

mkdir ~/Developer/Work/prototype-nuimotion/

– Copy Redist files to the root of the app:

cp -R ~/Developer/Work/NiTE-Linux-x64-2.2/Redist/* ~/Developer/Work/prototype-nuimotion/
cp -R ~/Developer/Work/OpenNI-Linux-x64-2.2/Redist/* ~/Developer/Work/prototype-nuimotion/

– Install `websocket`:

npm install websocket

– Install `node-gyp`:

sudo npm install -g node-gyp

– Create `prototype-nuimotion` and download the nuimotion project to the `node_modules` directory:

mkdir ~/Developer/Work/prototype-nuimotion/node_modules
cd ~/Developer/Work/prototype-nuimotion/node_modules
mv nuimotion-master nuimotion

– Rebuild:

cd ~/Developer/Work/prototype-nuimotion/node_modules/nuimotion
node-gyp rebuild

– Edit `index.js` to fix require, remove `src` prefix in first line:

vi ~/Developer/Work/prototype-nuimotion/node_modules/nuimotion/index.js
module.exports = require('./build/Release/nuimotion.node');

– Copy `basicquickstart.js` and run:

cp ~/Developer/Work/prototype-nuimotion/node_modules/nuimotion/quickstart/basicquickstart.js ~/Developer/Work/prototype-nuimotion/
cd ~/Developer/Work/prototype-nuimotion/
sudo node basicquickstart.js

– Reference:

Is the hardware being detected?

– Run `lsusb`:

lsusb | grep Xbox

– Should result in:

Bus 002 Device 006: ID 045e:02ad Microsoft Corp. Xbox NUI Audio
Bus 002 Device 005: ID 045e:02b0 Microsoft Corp. Xbox NUI Motor
Bus 002 Device 007: ID 045e:02ae Microsoft Corp. Xbox NUI Camera

Comments are closed.