Skip to content

Instantly share code, notes, and snippets.

Last active February 2, 2023 18:15
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save llamapope/890f15d0c81a1ce6075b016cd938ca4b to your computer and use it in GitHub Desktop.
Save llamapope/890f15d0c81a1ce6075b016cd938ca4b to your computer and use it in GitHub Desktop.
Setup XBox 360 Kinect with Processing 3 Ubuntu 16.04

Install Kinect Drivers (tested with Stable-

sudo ./

Or maybe...

sudo apt-get install libfreenect libfreenect-dev libfreenect-demos
# test with

If it isn't working, make sure your computer is able to see the Kinect

lsusb | grep Xbox

Should get something like this:

Bus 001 Device 025: ID 045e:02ae Microsoft Corp. Xbox NUI Camera
Bus 001 Device 023: ID 045e:02b0 Microsoft Corp. Xbox NUI Motor
Bus 001 Device 024: ID 045e:02ad Microsoft Corp. Xbox NUI Audio

If you don't, you may be able to get things working with some extra udev rules (not sure if these were needed or not... was trying to get this to work for a while) to /etc/udev/rules.d/51-kinect.rules

Once that is working, we just need to get processing talking to the Kinect.

Install Processing 3 - 64bit

Install SimpleOpenNi libraries into processing sketchbook libraries

git clone
cp -R simple-openni/SimpleOpenNi ~/sketchbook/libraries

Running this sample script:

import SimpleOpenNI.*;
SimpleOpenNI kinect; 

# NOTE: must use settings (not setup) for size() to use variables in P3
void settings() {
 kinect = new SimpleOpenNI(this);
 // enable depthMap and RGB image
 // enable mirror
 size(kinect.depthWidth()+kinect.rgbWidth(), kinect.depthHeight());

void draw() {
 // draw depthImageMap and RGB images
 image(kinect.depthImage(), 0, 0);

Code from Arduino and Kinect Projects, ©2012 by Enrique Ramos Melgar and Ciriaco Castro Díez
Chapter 3: Accessing the Depth Map and RGB Image

It is missing An error something like this is in the Processing output window:

Can't load SimpleOpenNI library ( : java.lang.UnsatisfiedLinkError: /home/ubuntu/sketchbook/libraries/SimpleOpenNI/library/ cannot open shared object file: No such file or directory
Verify if you installed SimpleOpenNI correctly.
UnsatisfiedLinkError: SimpleOpenNI.SimpleOpenNIJNI.swig_module_init()V
A library relies on native code that's not available.
Or only works properly when the sketch is run as a 32-bit application.

Google code doesn't exist anymore. Thankfully there was a reported issue:
wexstorm/simple-openni#79 (comment)

Which instructed us to dowload Boost 1.54.0

Extract, then install/setup


This takes a while to complete, but the file we need is complied near the beginning, so we don't actually have to wait.

cp bin.v2/libs/system/build/gcc-5.4.0/release/threading-multi/ ~/sketchbook/libraries/SimpleOpenNI/library/linux64

Run the program. Should have window with 2 outputs, RGB and depth camera views.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment