25
Mar

// How to: Install Kinect in Linux (Mint 12, Ubuntu 12.04)

This is  a simple and  short tutorial on how to set up Kinect for your Linux Mint 12 (It also should work fine with Ubuntu 10.10 Ubuntu 12.04). For this task OpenNI Framework is going to be used. The official short description of OpenNI is :

The OpenNI Framework provides the interface for physical devices and for middleware components. The API enables modules to be registered in the OpenNI framework and used to produce sensory data. Selecting the hardware or middleware module is easy and flexible.

This Tutorial will use the NITE middleware to enable skeleton tracking and avin2 Hardware binaries which will permit to use Kinect (for Xbox ) (Xbox and Windows Version) as the hardware. If  by any chance  you have a Kinect for Microsoft and want to use OpenNI you are out of luck; Until the publication date of  this  post there is no Hardware binaries that works with Linux.

 

To install KInect with OpenNI and NITE please follow the next 8 steps, with your Kinect Unplugged.

Step 1 - Install Required support library

First step is to check if you have all the needed libraries, and if they are up to date.

1
 sudo apt-get install libusb-1.0-0-dev freeglut3-dev g++

If you have a Nvidia graphics card it's recommended to have the latest drivers: Instruction here

Step 2 - Create a folder for holding the download and the installation

I recommend to create a 'kinect'  in your home folder:

1
2
cd ~
mkdir kinect

Step 3 - Download the OpenNI , NITE and AVIN2

It's going to be necessary to download to the created folder the latest OpenNI  Binary and the NITE middleware. Until the publication of this tutorial the most recent version available were :

  1. OpenNI stable build for Ubuntu 10.10 - v1.5.2.23
  2. PrimeSense NITE stable build for Ubuntu 10.10 - v1.5.2.21^* These version were the first stable release to support skeleton tracking without calibration pose.

* Update 06-JUN-2012*

If you are using  Ubuntu 12.04 make sure to have the following versions (or newer) :

  1. OpenNI UNstable build for Ubuntu 12.04- - v1.5.4
  2. PrimeSense NITE UNstable build for Ubuntu 12.04 - v1.5.2.21

You can download the latest modules here : http://www.openni.org/Downloads/OpenNIModules.aspx

It's also going to be necessary to download the avin2 hardware driver for Kinect : https://github.com/avin2/SensorKinect/zipball/unstable.

Step 4 - Extract the downloaded zip to the desired folder

Now Extract The files and Rename the folders:

Your 'kinect' folder should have 3 zipped files. Extract the OpenNI zip file and rename the folder to 'openni'.
Repeat the procedure for NITE renaming the new folder to 'nite'  and for avin2 renaming it to 'sensorkin'.
Step 5 - Install OpenNI

1
2
3
cd ~/kinect/openni/
chmod a+x install.sh
sudo ./install.sh

Step 6 - Install  AVIN2

1
2
3
4
cd ~/kinect/sensorkin/Platform/Linux/CreateRedist/
chmod a+x RedistMaker
sudo ./RedistMaker
cd ../Redist/Sensor-Bin-Linux-x64-v5.1.0.25

Please note that the Folder 'Sensor-Bin-Linux-x64-v5.1.0.25' might change name in new releases of AVIN2., Now continuing with the instruction set:

1
2
sudo chmod a+x install.sh
sudo ./install.sh

Step 7 - Install NITE

1
2
3
cd ~/kinect/nite/
chmod a+x install.sh
sudo ./install.sh

Step 8 - Test it!

Go ahead and plug in your Kinect to the outlet and to your USB portNow lets try to run a few samples programs that come along with OpenNI, to do so go to you Bin Release folder and run one of the program of your choice, for instance:

1
2
cd ~/kinect/openni/Samples/Bin/x64-Release/
./Sample-NiSimpleSkeleton

Done, everything should be working fine by now. If any doubt in OpenNI arrises check the Official OpenNI google group

 

Enjoy

  • xuorx

    Hello
    Thank a lot for your tutorial, but i'm locked when i install AVIN2.
    I used Linux Mint 12 and when i execute ./Redistmarker, he don't work.
    Can you help me ? i'm french.

    • igorbarbosa

       Sure thing.
      Can you be more specific ?
      What do you mean by saying the command don't work ?
      What was the output ?
      Would be helpful to send a print-screen including of the last two commands as well.

    • http://www.facebook.com/davide.caminati.75 Davide Caminati

      if you see the log... probably find
      "/bin/sh: g++: not found"
      FOR FIX USE
      sudo apt-get install g++

      • igorbarbosa

        I've probably had g++ before. Thanks for the info, the post has been updated.

  • http://www.facebook.com/davide.caminati.75 Davide Caminati

    Good Work!!!,
    But you have miss
    sudo apt-get install g++as prerequisite :)

    • igorbarbosa

      I've probably had g++ before. Thanks for the info, the post has been updated.

  • Kim

    Thanks a lot for your guide. Worked like a charm here on Ubuntu 12.04 (32 Bit) . Had to "sudo apt-get install g++" too though...

    • igorbarbosa

      I've probably had g++ before. Thanks for the info, the post has been updated.

  • Ricardo Salinas

    this guide works in 64-bit ubuntu12.04?

    • igorbarbosa

      Yes.

  • Eiris_221

    I LOOOVVVEEE YOUUUU DUDE!!!

  • Pingback: Kinect depth maps and Python | Entrepreneurial Geekiness

  • Pingback: Como instalar Kinect en Ubuntu 12.04 /How to: Install Kinect in Linux (Mint 12, Ubuntu 12.04) | Kinect_tallerdeIntegracion | Scoop.it

  • Tristan

    Hi there, thanks for the steps to install. . . Most things worked a charm. . .
    Its just i cant find anywhere where i can download NITE from? Please let me know where i can get it from.
    I'm trying to use a kinect on ubuntu 12.04.

    Thanks

    • igorbarbosa

      1 - Go to http://www.openni.org/Downloads/OpenNIModules.aspx2- Select the  from the first drop down menu the option Openni  Compilant Middleware Binaries

      Got it ?Middleware binaries = Nite
      Cheers Mate!

      • Tristan

         Hi yes, thanks for that. . . I worked it out after a while.  It was just a little confusing because as you said in your post its under "
        Openni  Compilant Middleware Binaries" only then do you see NITE. . .

        • Tristan

          Hi there,
          I'm getting an error on most of the sample programs.

          Ive got OpenNI and a Kinect on Ubuntu 12.04.

          The sample program NiViewer works fine but most others like Sample-NiSimpleSkeleton are giving an error output like this:

          Reading config from: '../../Config/SamplesConfig.xml'
          Starting to run
          Illegal instruction (core dumped)

          (when I run as sudo, nothing happens after "Starting to run")

          If you have any ideas what could be causing this or what i can do about it, please let me know.

          Many thanks in advance.

          Tristan

          • igorbarbosa

             Try another sample program. ;)

          • igorbarbosa

             How does  it work with Niviewer ?

  • Munfis

    Hi there, thanks for the tutorial.

    I went through all the steps, but somehow I can't open any of the sample programs. I checked the properties of the samples and they don't have anything assigned to execute with. Did I miss something?

    Thanks for the help

    • Munfis

       Nevermind, a restart fixed it. thanks this is awesome

  • aris

     root@vaio:/home/aris/kinect/OpenNI/Samples/Bin/x86-Release# ./Sample-NiSimpleSkeleton
    Reading config from: '../../Config/SamplesConfig.xml'
    Open failed: Got a timeout while waiting for a network command to complete!

    • igorbarbosa

      This looks like it cannot find the configuration file for the program.

      Is not a matter of wrong instalation, but either you are running the wrong program, or the config file is missing.

      This problem is common in OpenNI google group, please refer to it.

      • igorbarbosa

         Try running the Niviewer ;)

    • igorbarbosa

       Try running other samples programs. NiViewer is pretty simple and normally works.

    • igorbarbosa

       Some computer are not running the AVIN2 command.
      There is a simple workaround:

      sudo modprobe -r gspca_kinect

      More info: https://groups.google.com/forum/?fromgroups=#!topic/openni-dev/cdbZnefIAT8

  • Patrick

    Hello thanks for the very helpful post.  When I go and try to run the program it just gets stuck on "Starting to run" and then never does anything.  I haven't let it stay like that for more than 10 minutes just because it doesn't seem like it is getting anywhere.  I have rebooted and retried the install but it hasn't changed.  Any idea what could be causing this?

    • igorbarbosa

       Make sure you are not using the Kinect for windows and it is not a usb 3.0

      • Patrick

        hmm yes it is a Kinect for Xbox and I am using USB 2.0 on my laptop.

        • igorbarbosa

           I do not know from where the error is coming from. I just tried the hole process from scratch and it runs like a charm.

          I would recommend debugging some error with the official community for your case: http://groups.google.com/group/openni-dev/

    • igorbarbosa

       Are you using Kinect for windows or Kinect for XBOX 360 ?
      Are you sure you followed the tutorial correctly.
      I recently tried and It worked just fine.
      Some people reported to me that due to previous installation a few things wore broken in their computer. Make sure you have unistalled everything.

      Which Ubuntu Are you using ?

      Also make sure you are not using USB 3.0.

      Cheers!

    • igorbarbosa

      Some people are reporting similar problems.
       But it is working for most of them.
       Maybe you are unlucky. There is a proposed fixed here.
      Take a look at this thread: https://groups.google.com/forum/?fromgroups=#!topic/openni-dev/cdbZnefIAT8

  • http://villalobos.com.br Pedro Villalobos

    Works like a charm on my old MacBook4,1 (White 2008) with Linux Mint Maya on it... thanks :)

    • igorbarbosa

       Good to know!

  • Clifgray

    On the current version of avin2 which I believe is 5.1.2.1 I cannot find the install.sh Do you have any idea where it is or how the instructions change for that new version?

    • igorbarbosa

      The last I did this was 2 weeks ago.
      I will try with the new version and Update it. I Also will leave a comment here

    • igorbarbosa

      I hat the Install script in /kinect/sensorkin/Platform/Linux/Redist/Sensor-Bin-Linux-x64-v5.1.2.1

      I tried everything on a fresh install of Linux Mint 13.

      Cheers

  • http://miloq.blogspot.com/ Manuel Ignacio López Quintero

    Great! It works perfect on my Ubuntu 12.04 LTS! Thank you very much!

    • igorbarbosa

       Good to Know!
      =)

  • 성민 최

    thanks for install information of Kinect 

    but i cant operate NiViewer and others

    my Ubuntu is 12.10 and 

    if i operate Niviewer or some samples

    i can see this message

    Open failed : Xiron os got an event timeout

    Open failed : Got a timeout while waiting for a network command to complete

    how can i solve it?

    • igorbarbosa

       I do not know if OpenNI is supported on Ubuntu 12.10.

      Their official drivers inform us they run on Ubuntu 12.04.

      Try taking a look at the forum http://groups.google.com/group/openni-dev/

      Also there are some good information on the comments below.

      • lynber

        I also see  Open failed : Xiron os got an event timeout
         Open failed : Got a timeout while waiting for a network command to complete
        I tried a lot of answers or solutions on net,but it just doesn't work out,and i am really anxious,please help me! thanks very much!
        my environment: vmware, 32bit ubuntu12.04 ,openni 1.5.4.0, nite 1.5.2.21, sensorkinet5.1.2.1

        • lynber

          I use kinect for xbox360 which is cheaper,does that matter?  I can see xbox nui motor,xbox nui audio,xbox nui camera when lsusb command is used

        • igorbarbosa

          I believe is not supported in Virtual Machines (VMWARE)

          Because of USB rules and so on.

          • lynber

            thank you for your reply,but when I use openkinect(another Open source community )on vmware,it works normally. So i am really confused. 

  • http://www.facebook.com/profile.php?id=100000787487533 Javier Montenegro

    Great! Thank you very much, too
    the details of the change of name of the folder, very good

  • http://www.facebook.com/profile.php?id=100000787487533 Javier Montenegro

    Great! Thank you very much, too
    the details of the change of name of the folder, very good

  • Pingback: Настраиваем Kinect for Windows (k4w) в Ubuntu » PandaCoder

  • Pingback: Starting out with OpenNI « Benjamin Farrell

  • Sean

    ou can download the latest modules here : http://www.openni.org/Downloads/OpenNIModules.aspx

    page not found :(

    • http://www.igorbarbosa.com igorbarbosa

      You can find them in thei GIThub site.
      I will update this tutorial soon. ;)

  • Zaman

    Worked Perfectly!

  • Pingback: How To Install OpenNI For Kinect | Click & Find Answer !

  • Pingback: How to Install OpenNI for Kinect | Ubuntu InfoUbuntu Info

  • Pingback: How to Install OpenNI for Kinect | WyldePlayground.netWyldePlayground.net -

  • Pingback: PyOpenNI + PyGame | yetanotherlog

  • Rita Angélico

    Hi,

    Thanks for the awesome tuturial!

    I installed OpenNi and Nite with no problem (on Ubuntu Quantal), but I faced a problem when running ./RedisMaker of th Avin2
    "make[1]: Leaving directory `/home/rita/kinect/sensorkin/Platform/Linux/Build/XnDDK'" and the folder Redist wasn't created so I am not able to install Avin2 SensorKinect.
    I followed every step of this tuturial. Does anyone know how to fix this problem?

    Thanks!

    • Ian Schweer

      So I ended up having to hand merge this pull request to fix that problem. https://github.com/avin2/SensorKinect/pull/5

      • N. S.

        Thanks, I had the same problem.

        • ODBWilson

          Can you show me how to fix the problem?
          Thanks!

          • N. S.

            Well, that's kind of weird, but... I thanked Ian before testing it. I merged the code, but I still get error messages and couldn't finish it. If you discover anything, WIlson, please let me know aswell. If I get any news I'll post here too. Thanks!

  • Mariusz Wilk

    Hi all,

    I am stuck at installing the openni. I get this message:

    "mar@mar-DT2412:~$ cd kinect/openni/

    mar@mar-DT2412:~/kinect/openni$ chmod a+x install.sh

    mar@mar-DT2412:~/kinect/openni$ sudo ./install.sh

    [sudo] password for mar:

    Installing OpenNI

    ****************************

    copying shared libraries...OK

    copying executables...OK

    copying include files...OK

    creating database directory...OK

    registering module 'libnimMockNodes.so'..../install.sh: 113: ./install.sh: /usr/bin/niReg: not found"

    I can't figure out what's wrong here. I use Ubuntu 12.04.

    Does anyone have any idea on how to tackle it?

aSalada