Jump to content

Installing OpenKinect and as3Kinect for Popular OSs

+ 1
  imekinox's Photo
Posted Feb 15 2011 06:25 PM

Installing OpenKinect and as3Kinect for Popular OSs
This article guides you through the steps required to get your Kinect working with your computer.

What Equipment Do You Need?

You need two pieces of equipment to get your Kinect working with your computer:



Note: If you bought your Kinect separately from your Xbox 360, you should already have the Power supply and cable; however, if you bought a Kinect bundled with the XBox, you don’t, and you will need to get one to connect it to your computer. This cable was originally intended to be used with older Xbox 360 consoles, which do not have the Kinect custom port.


What Do You Need to Install?
The exact software you need depends on what OS you are running on your computer, as described below.

Installing On Windows
When you first plug the Kinect into your computer, you'll get a notification
telling you that Windows cannot find any drivers for the Kinect hardware. That’s supposed to happen, because you haven’t installed them yet.

You can download the drivers fromhttp://as3kinect.org...ect_drivers.zip.

After you have downloaded and extracted freenect_drivers.zip, you need to open the Device Manager from the Windows Control Panel by clicking Start | Control Panel | Device Manager.

Note: If you have already experimented with any other Kinect drivers (NUI or OpenNI), you’ll need to remove those first.


Then, for each device (camera, motor and audio), right-click Update Driver Software, and select "Browse my computer for driver software." Select the extracted folder freenect_drivers).

Note: If this does not work, right-click Update Driver Software again, and this time, instead of selecting the folder, choose “Let me pick from a list, ” then "Have Disk…" and finally, "Select the corresponding .inf file."


You need the Microsoft Visual C++ 2010 Redistributable Package installed. If you don’t already have it installed, you can
download it here.

Then just follow the installer instructions to install the Microsoft Visual C++ 2010 Redistributable Package.

At this point you have completed the most difficult parts of this guide. The only things you're missing are the application binaries. Here’s how to get them.

Download the archive file http://as3kinect.org...server_0.9b.zip.
When you unzip this archive, you will find the following files:

  • as3-server.exe—This is the bridge to ActionScript.
  • freenect_sync.dll—Part of the OpenKinect API. This is used to get the data when it can be processed instead of when it is available.
  • glut32.dll—This is an OpenGL library dependency.
  • pthreadVC2.dll—Unix multithreading library
  • freenect.dll—This is the OpenKinect main library (driver)
  • glpclview.exe—Demo from OpenKinect (3D projection of depth and color).
  • glview.exe—Demo from OpenKinect (2D projection of depth and color).
  • libusb0.dll—USB library
  • tiltdemo.exe—Demo from OpenKinect for controlling the Kinect's tilt position motor.

Double-click the glview.exe file to see the first example made using OpenKinect; it will show you both the video stream and a colored depth stream.

For a more complex demo that uses depth and video data, open glpclview.exe. This time you’ll see a 3D representation of what the Kinect “sees.”

You also need the AS3 client, which you can download from
http://as3kinect.org...mo_pkg_0.9b.zip. The freenect_demo_pkg_0.9b.zip file contains as3 binaries and client source files. First, run as3-server.exe, and then run test.exe to see how it works.

That’s it! By following these instructions, you can use the Kinect with any Windows computer.

Installing On OSX

The Kinect also works well on OSX; in fact, it’s even simpler to use on OSX than on Windows.
First, plug your Kinect into your computer, and then download the OSX installer from
http://www.as3kinect...kinect_0.9b.pkg.

After downloading the file, double click on the as3kinect_0.9b.pkg file and follow the installation prompts (the install will ask you for your administrator password, because it installs files in system folders).

When the installation completes, open the Terminal app. Type glview, and then press Enter to see the first example made using OpenKinect, which shows you both the video stream and a colored depth stream.

For a more complex demo that uses both depth and video data, type glpclview, and then press Enter; this time you’ll see a 3D representation of what the Kinect "sees."

To use your Kinect with ActionScript, type as3-server, and
then press Enter. Wait until the ##Wait connection message appears.

You also need the AS3 client, which you can download from
http://as3kinect.org...mo_pkg_0.9b.zip. The freenect_demo_pkg_0.9b.zip file contains as3 binaries and source files. First, run the as3-server.exe file, and then run test.app to see how it works.

That’s it!

Installing On Linux
To run your Kinect with Linux you may need to compile some components yourself, but if you have Ubuntu, Fedora, or Debian you can use apt-get to install freenect. Just update the repo list with:
sudo apt-get update


Then install freenect:
sudo apt-get install freenect


You may need to add your user to the video group:
sudo adduser username video


Finally, to start the glview demo, just type freenect-glview.

There are some alternative OpenKinect Linux binaries available, and you can find them by following these links:


Note: These packages may or may not contain as3-server but they should provide you with the basic OpenKinect examples.



Here is a video demonstrating the process to run as3-server and its client:



In that video, you'll first see my Flash environment, along with a small portion of the source code. Before the client can run, you need to execute as3-server (In the video I’m using the Windows version as3-server.exe, on Unix, you’ll type as3-server in your console/terminal to achieve this).

After the server displays the "Wait client" message you need to run the client,
press Ctrl+Enter in the Flash IDE. Wait for the connection to establish, and you’ll see the video and depth images in your Flash project.

After that, you can play with your device by changing the LED color, the tilt position, and the depth range of the displayed depth stream.

Future Steps
If you’d rather compile your own binaries, the next article in this series will discuss how to compile OpenKinect and As3Kinect on Unix and Windows systems. For further information or community support, visit
these pages:



About the Author

Attached ImageJuan Carlos del Valle, who you may know online as ekinox or imekinox, has been working with ActionScript, PHP and MySQL for five years, developing web applications for publishing digital media. He's also familiar with Objective-C, C, C++, C#, Python, node-js, Javascript, jQuery, HTML5 and CSS3. He is currently part of a small team that does research and development. He enjoys experimenting with new technologies and programming languages.


Tags:
2 Subscribe


3 Replies

0
  AMulder's Photo
Posted Feb 25 2011 11:27 AM

Followed your instructions to install this on Windows 7 (32bit) and when I try to execute any of the apps (glview, glpclview, as3-server) I get the same error:

"freenect_win_as3server_0.9b\libusb0.dll is either not designed to run on Windows or it contains and error."
0
  AMulder's Photo
Posted Feb 28 2011 07:49 AM

Just found that the libusb0.dll packaged with the demo software here:
http://nicolas.burru...KinectRgbDemoV4

works as a drop-in replacement for this libusb0.dll
0
  luizaprata's Photo
Posted Jul 28 2011 03:00 PM

how does get the skeleton to work?