Setting up the Kinect on OSX (El Capitan)

Kinect.png

With Apple buying out PrimeSense (Thanks Apple…), installing the Kinect on OSX has become a little fumbly. Here’s a step by step guide on getting it up and running.

 

Disable System Integrity Proctection

System Integrity Protection (SIP) is a new default security measure introduced by Apple in OS X 10.11 onward. This rootless feature prevents Mac OS X compromise by malicious code, therefore locking down specific system level locations in the file system. This prevents the user from making changes to the system via Sudo commands. Therefore in order for us to proceed, we need to turn it off.

  • Restart your Mac in Recovery mode
    • Restart your Mac holding down Cmd-R
  • Find  Terminal in the Utilities menu and type in the following : csrutil disable
  • Restart your Mac

Great! Easy start. Now we will be able to have full access.

Download and install MacPorts

http://www.macports.org/install.php

 

Install Dependencies

  • First we have to download a few libraries in order to get the USB port on your Mac working with the Kinect. If you haven’t got them already.
  • Go into Terminal and type:

—————-

sudo port install libtool

—————-

  • Now restart your Mac
  • Next, install the development version of libusb. Type into Terminal:

—————-

sudo port install libusb-devel +universal

—————-

  • Once its been installed, restart your Mac once again.

Install OpenNI

  • (Optional) Create a Kinect directory in Home to place all applications you’ll need to run the Kinect on the Mac.
  • Open up Terminal and type in:

—————–

mkdir ~/Kinect

cd ~/Kinect

—————–

  • As the download page from the Primesense website is not working. Here’s a link to the OpenNI unstable release. Do not try to Download OpenNI v2 beta as it relies solely on the Microsoft Kinect SDK which we cannot use. The version we are going to use is OpenNI SDK (V1.5.7.10)
  • https://mega.nz/#!yJwg1DJS!uJiLY4180QGXjKp7sze8S3eDVU71NHiMrXRq0TA7QpU
  • Move the Zip file to your Kinect folder and double-click to uncompress and reveal the SDK folder.
  • Open Terminal and navigate to the OpenNI SDK folder.
  • Once in the folder, type:

—————-

sudo ./install.sh

—————-

Install SensorKinect

  • First type this command in Terminal to prevent errors when installing SensorKinect.

—————

sudo ln -s /usr/local/bin/niReg /usr/bin/niReg

—————

  • Go to this Github repository and click Download ZIP.
  • https://github.com/avin2/SensorKinect
  • Move the Zip to the Kinect folder and uncompress it
  • Navigate to the SensorKinect093-Bin-MacOSX-v5.1.2.1.tar file inside the Bin folder and uncompress it.
  • Open Terminal and navigate to the SensorKinect093-Bin-MacOSX folder
  • Install by typing the following command:

————–

sudo ./install.sh

————-

  • It will prompt you to enter your password
  • If it works it will install the Primesense sensor

————-

Install NiTE

  • Last thing to install. Go here and download NiTE-Bin-MacOSX-v1.5.2.21.tar.zip
  • Add this file to your Kinect folder and uncompress it
  • Go into Terminal and navigate to the NiTE folder
  • Install NiTE by typing in the following command:

————-

sudo ./install.sh

————-

Once that is done, you’ve pretty much finished! Now try and run some examples!

  • Plug in the Kinect
  • Copy the sample XML files from NiTE/Data over to the Data folder in SensorKinect
  • Open Terminal and navigate to NiTE/Samples/Bin/x64-Release
  • Run the first Demo by typing in the following command:

————

./Sample-PointViewer

————

If everything is setup correctly then a new window should pop up and display a tracking demo!

(Note: You might want to restart and enable the SIP again if you want)

 

24 thoughts on “Setting up the Kinect on OSX (El Capitan)

  1. Thank you for this tutorial, well explained and covers pretty much everything it needs to.
    Just 2 things:
    – on “Install NiTE”, the “Go here and download” instructions doesn’t contain any links – I googled the contents and downloaded it from somewhere else;
    – I’ve followed step by step, and when I try to run the sample, the last message shown in Terminal is “Device: Primesense/SensorKinect/5.1.2.1: The device is not connected!”, even though my System Report shows that the Kinect is connected to my USB3.0 port.
    Can you help me?

    Liked by 4 people

  2. Hello, I dont work to well with code and terminal but I have been following these tutorials closely and researching the best I can. I just hit a bump with the first install.sh command.

    Installing OpenNI
    ****************************

    copying shared libraries…cp: /usr/lib/libOpenNI.dylib: Operation not permitted
    cp: /usr/lib/libOpenNI.jni.dylib: Operation not permitted
    cp: /usr/lib/libnimCodecs.dylib: Operation not permitted
    cp: /usr/lib/libnimMockNodes.dylib: Operation not permitted
    cp: /usr/lib/libnimRecorder.dylib: Operation not permitted
    Shanes-MacBook-Pro:OpenNI-Bin-Dev-MacOSX-v1.5.7.10 shane$

    Any help is great, Im just trying to make cool projections..
    Thanks!!
    —Shane

    Like

  3. copying shared libraries…OK
    copying executables…cp: /usr/bin/niReg: No such file or directory
    iMac-di-Marcello:OpenNI-Bin-Dev-MacOSX-v1.5.7.10 Ferraris$ sudo ln -s /usr/local/bin/niReg /usr/bin/niReg
    ln: /usr/bin/niReg: File exists
    iMac-di-Marcello:OpenNI-Bin-Dev-MacOSX-v1.5.7.10 Ferraris$ sudo ./install.sh
    Installing OpenNI
    —————————
    creating config dir /usr/etc/primesense…OK
    copying shared libraries…OK
    copying executables…OK
    registering module ‘libXnDeviceSensorV2KM.dylib’ with OpenNI…./install.sh: line 111: /usr/bin/niReg: No such file or directory
    iMac-di-Marcello:Sensor-Bin-MacOSX-v5.1.2.1 Ferraris$ cd /Users/Ferraris/Desktop/Kinect/NITE-Bin-Dev-MacOSX-v1.5.2.21
    iMac-di-Marcello:NITE-Bin-Dev-MacOSX-v1.5.2.21 Ferraris$ sudo ./install.sh
    Password:
    Installing NITE
    ——————————-
    Copying shared libraries… OK
    Copying includes… OK
    Installing java bindings… OK
    Installing module ‘Features_1_3_0’…
    ls: Features_1_3_0/Bin/lib*dylib: No such file or directory
    Installing module ‘Features_1_3_1’…
    ls: Features_1_3_1/Bin/lib*dylib: No such file or directory
    Installing module ‘Features_1_4_1’…
    ls: Features_1_4_1/Bin/lib*dylib: No such file or directory
    Installing module ‘Features_1_4_2’…
    ls: Features_1_4_2/Bin/lib*dylib: No such file or directory
    Installing module ‘Features_1_5_2’…
    Registering module ‘libXnVFeatures_1_5_2.dylib’… ./install.sh: line 41: niReg: command not found
    iMac-di-Marcello:NITE-Bin-Dev-MacOSX-v1.5.2.21 Ferraris$ sudo ln -s /usr/local/bin/niReg /usr/bin/niReg
    ln: /usr/bin/niReg: File exists
    iMac-di-Marcello:NITE-Bin-Dev-MacOSX-v1.5.2.21 Ferraris$ ./Sample-PointViewer
    -bash: ./Sample-PointViewer: No such file or directory
    ————————————-

    For me it doesn’t work. How I can fix it?

    Like

  4. Hey,

    First of all, thanks for this awesome tutorial. I followed all your steps however at the last step when I try to run the demo I get the following message in Terminal:

    590 INFO New log started on 2016-07-29 16:53:33
    614 INFO OpenNI version is 1.5.7 (Build 10)-MacOSX (Nov 12 2013 13:39:54)
    617 INFO — Filter Info — Minimum Severity: UNKNOWN
    One or more of the following nodes could not be enumerated:

    Device: PrimeSense/SensorKinect/5.1.2.1: The device is not connected!

    Could you help me out here? Thanks so much and kind regards

    Liked by 2 people

  5. Hey!
    Thank you for the instructions. Here’s the thing though-
    I followed each step, and now when I type in the “./Sample-PointViewer” command, I get this message:
    “InitFromXmlFile failed: Failed to open the USB device!”

    What could this mean?

    Thanks again,
    A

    Like

  6. Hi there,

    when installing OpenNI with the script you provided, I get this error…
    COMPUTER:OpenNI-Bin-Dev-MacOSX-v1.5.7.10 myUser$ sudo ./install.sh
    ls: /Volumes/Macintosh: No such file or directory
    ls: HD/Users/myUser/Kinect/OpenNI-Bin-Dev-MacOSX-v1.5.7.10/./Lib/*: No such file or directory

    Been trying to debug it but can’t seem to find why this happens…

    Any idea?

    Like

  7. Hi¡ Very thanks for your tutorial, when I put “sudo port install libusb-devel +universal” the results its: “Error: Unable to execute port: Can’t install libusb-devel because conflicting ports are active: libusb”
    Help please. Im from Mexico, i need this for an art project.

    Like

  8. Thank you, It works! But after 5-6 seconds it stops tracking and pop-up window turns black(although it captured black-n-white scene), what might be a cause of that problem?

    Thank you,
    Best wishes

    Liked by 1 person

Leave a comment