Monday, February 25, 2013

Kinect + Unity 3D Glossary: Sorting out the noise

The goal seems simple enough.  I just want to build a 3D game in Unity which utilizes the motion-tracking capabilities of the Kinect and the amazing VR abilities of the Oculus Rift.  Since the Oculus won't actually be delivered to me for another few months, that leaves integrating only the Kinect. Seems simple enough.

The problem is, I have no idea where to start.  I've only dabbled in game development - and by dabbled, I mean I watched all the "Getting Started With Unity" tutorials at Unity Cookie - and I know nothing of motion-tracking.  But I do know programming, which is why I thought things would be super simple. So simple, in fact, that by the time I opened my nice and shiny, brand new Kinect 360 sensor, I had practically deluded myself into thinking that I was just a few tiny drivers away from seeing an avatar of myself jumping up and down on my computer screen.

Yeah, no.

Right after opening that box and seeing the beautiful Kinect staring back at me, I started looking for the necessary drivers/wrappers/etc.  It only took about ten minutes for me to understand how much I don't understand.  The problem was an overload of new terminology.

So to make things easier for me, and hopefully for whoever else runs into the same problem, I'm breaking things down here. In many cases, I'm not necessarily going to paraphrase what was written about some of these glossary terms, because frankly some of it doesn't yet make perfect sense to me.  But I will provide the links I found useful in deciphering exactly what was needed, what wasn't, and why.   

Glossary Relating to Motion-Tracking and Unity

 OpenNI  - An open-source framework for 3D natural interaction sensors. I found a good link here which explained why it would be very good to download and use OpenNI 2.0 as a means of connecting to and utilizing the Kinect.  According to the author of that link, the SDK "gives you access to the raw data provided by the sensor" (in my case, the Kinect).

NiTE - Termed "middleware," it is described by the author of this article  as being the glue which allows the respective sensor SDK to access to higher level "processed" - gestures and skeleton detection and tracking of the sensor. According to that same author, PrimeSense's middleware, NiTE 2.0 has been revamped to work with the new OpenNI 2.0 SDK.

Microsoft Kinect SDK - This is the official SDK created by Microsoft for their Kinect sensor.  I imagine there is a lot of overlap between this and the OpenNI/NiTE, but even if you are using  OpenNI/NiTE, you still need to download this because it comes with some drivers that you apparently can't get anywhere else (mentioned in the same article as before). It should be noted, however, that according that same author, "The latest Microsoft SDK also has more resources and features [then OpenNI/NiTE], and comes with the 'middleware' built in. It also allows you to code in .NET languages as well as C++." 

PrimeSense - A company which specializes in Natural Interaction device development (basically, devices that pick up your movement). These guys are in no small part responsible for the magic inside the Microsoft Kinect, and are now currently producing devices that will be in direct competition with the Kinect. Furthermore, as mentioned before, PrimeSense created the NiTE middleware (just scroll down until you get to the NiTE section).

SensorKinect - Written by PrimeSense, it described by this article as follows: "In simple terms, OpenNI and SensorKinect are the drivers that help to access RGB-D data [Depth & Color] from the Kinect. Interestingly, the latest version of OpenNI (2.0) makes installing the SensorKinect redundant.

KinectWrapperPackage - The KinectWrapperPackage is the Unity wrapper used by this project to bind the official Kinect SDK (version 1) to Unity. I've included it in this list because it came up a lot in my searches.  Personally, I wouldn't use it because: a) it doesn't seem to be updated or continually supported, and b) it is based on an old Kinect SDK and an old version of Unity, and therefore not all of the functionality will work anymore (unless you want to continue developing using the old stuff).

KinectSDK / Unity3D Interface v5 - Another wrapper which binds the Kinect SDK to Unity.  And while this seemed to be a good solution at the time it was written, it hasn't been updated since early 2012, the author has stated explicitly that he has no intentions of updating it, and it was only written to be compatible with the official Kinect SDK v1. But the source code is there, if one is so inclined to try and adjust it to be compatible with more current SDKs.

UnityWrapper - The open-source UnityWrapper appears to be the first official attempt to bind OpenNI to UnityHowever, it was written using previous versions of the various SDKs, and - from what I can tell - hasn't been updated in over a year.

Zigfu/ZDK - Most of the founders and co-founders of this company are former PrimeSense and Microsoft men, so it almost goes without saying that they know what they're doing.  Furthermore, Amir Hirsch, the main founder (from what I can tell), helped author the popular UnityWrapper which integrated the Kinect into Unity.  Using what he built for that, he then moved on and created the ZDK - a more advanced wrapper that binds the Kinect to Unity, and exposes a lot of the power of OpenNI.  There's a free version of the ZDK for non-commercial use, and a $200 version for commercial use.

Omek Beckon SDK - According to the installation guide which you get after downloading the SDK, Omek Beckon is mutually exclusive with the Kinect SDK.  Meaning, if you have the Kinect SDK on your machine, you have to remove it. UPDATE!  I had previously said that one had to download OpenNI and NiTE to get this working, and that's entirely wrong.  One need only read the Beckon Installation Guide to get things moving.  I should note, however, that as of Feb. 24, 2013, the Beckon SDK did not use the most recent version of OpenNI, and they did use other drivers/wrappers that I've mentioned are already are considered older (such as the SensorKinect). On the other hand, they do have some really cool features, such as the Gesture Authoring Tool, as well as some other out of the box functionality from their Motion Toolkit for Unity.

Unity 3D free / pro - A fantastic program which enables even non-programmers to quickly create 3D and 2D games. 

...And that's it!  For now.  I'll add more terminology as I come across them. And if you feel like I missed something important that should be here, tell me and I'll put that up, too.

1 comment:

  1. Yeah a good article their, but i was wondering what's the best solution available to run the kinect with the Unity3D ?