Unity and the Kinect SDK

The Discussion

  • User profile image
    Yorman

    Hello

    Is this wrapper for version 1.0 or the beta?

  • User profile image
    gduncan411

    @Yorman: Based on the dates of the updates, pages, the files in the zip's, etc, I believe it's for v1 (at least that's what I hope, I'm trying to only highlight v1 based projects).

  • User profile image
    yormanh

    Hello

    I think it's the beta version because it tries to access:
    C: \ Program Files (x86) \ Microsoft Research KinectSDK \ MSRKINECTNUI.DLL

  • User profile image
    gduncan411

    @yormanh:GRRR... I missed this line on the site, "NOTE: Before installing, ensure that the Kinect is NOT connected to your machine. Also, since we are not using the new version of Kinect SDK, do NOT download it from Microsoft website."

    So yeah, this looks like it's NOT v1. My bad causing the confusion...

    Still if you find this project interesting, I would recommend you contact the authors and encourage them to release a v1 compatible version...

  • User profile image
    gduncan411

    @yormanh:Besides my comment above, I've also added an Update note to the post...

    I'm on the verge of pulling the whole post entirely, but I think the idea behind it is cool and really hope to generate some interest and support for a v1 version, so am leaving it up for now.

    Thanks for pointing this out and helping me on this...

  • User profile image
    yormanh

    Hello

    if the idea is interesting but I don't know to get the name of the class

    for example

    [DllImportAttribute (@ "C: \ Program Files (x86) \ Microsoft Research KinectSDK \MSRKINECTNUI.DLL", EntryPoint = "NuiInitialize")]
    public static extern int NuiInitialize (NuiInitializeFlags dwFlags);

    This version does not get the EntryPoint or method names, you know? or the class KinectSensor?

    for example (this doesn't  work)
    [DllImportAttribute (@ "C: \ Program Files \ Microsoft SDKs \ Kinect \ v1.0 \ Assemblies \ Microsoft.Kinect.dll", EntryPoint = "Start")]
    public static extern int Start ();

  • User profile image
    lucabertine​tto

    Actually I'm using the v1.0 SDK...so this process won't work with me?

  • User profile image
    lucabertine​tto

    No, it doesn't work :(
    DllNotFoundException: C:\Program Files (x86)\Microsoft Research KinectSDK\MSRKINECTNUI.DLL

    I would really appreciate if somebody could link me a way to bridge the Kinect SDK 1.0 to Unity.

  • User profile image
    haknick

    Well, this is definitely great and would be very useful to a lot of devs. That it doesn't work with v1 is obviously a turn off. Where would be the right place to ask and see if an update would be possible ?

  • User profile image
    gduncan411

    @haknick: Good question. Using the page history I believe I've found a point of contact for that project. I've just shot them an email asking if they are indeed a good PoC and if there's any work on a v1 version.

    If/when I hear more, I'll post a follow-up comment.

  • User profile image
    gduncan411

    There is indeed work being done on a v1 version... As I learn more I'll let you know. Smiley

  • User profile image
    Niranjan

    Thw wrapper works with v1.0, all have you have to is change the .dll path in the script "KinectInterop" to "C:\Windows\System32\Kinect10.dll"

  • User profile image
    gduncan411

    Also just found this, thought you might find it interesting...

    https://github.com/adevine1618/KinectSDK-Unity3D_Interface_Plugin

    "This is a wrapper that allows the user to access Microsoft's Kinect SDK v.1.0 data from inside the free Unity3D game engine much faster than a TCP socket connection"

    This project was just updated for the v1 SDK a few days ago...

  • User profile image
    yormanh

    hello

    sorry I had not read this post.

    Thanks Niranjan, it is true that by changing the path works but I have a problem, thefirst run and it starts but the second time Unity3D dies and does not respond,does  someone this happen?

  • User profile image
    lucabertine​tto

    @Niranjan: Thanks, now it's working Smiley

    @yormanh: I modified the source KinectInterop.cs that you can find in the 'NewKinet' example project, change all the dll at the end of the file with "C:\Windows\System32\Kinect10.dll", and THEN I opened the project with unity.
    I tried to modify it one time inside unity, with mono, but it crashed afterwards.

    @all: if there is participation it would be great to open a Google group, I think Big Smile 

  • User profile image
    yormanh

    Hello

     

    I was reading in the file KinectSensor.cs 

    // The MSR Kinect DLL (native code) is going to load into the Unity process and stay resident even between debug runs of the game.
    // So our component must be resilient to starting up on a second run when the Kinect DLL is already loaded and
    // perhaps even left in a running state. Kinect does not appear to like having NuiInitialize called when it is already initialized as
    // it messes up the internal state and stops functioning. It is resilient to having Shutdown called right before initializing even if it
    // hasn't been initialized yet. So calling this first puts us in a good state on a first or second run.
    // However, calling NuiShutdown before starting prevents the image streams from being read, so if you want to use image data
    // (either depth or RGB), comment this line out.
    //NuiShutdown();

     

    I don't know if there is solve for this problem, I am now investigating more. The group is a good idea.

    Anyone know how to contact the developers of the wrapper?

    a greeting

     

  • User profile image
    fdfragoso

    Hello,

    Thanks Niranjan, I changed the DLL path, Unity didnt crashed (lie - now is crashing when I try to play the app) and when I have an GameObject to show the RGB or Depth Camera from Kinect i'm get the following error: 


    NullReferenceException: Object reference not set to an instance of an object
    System.String.memcpy1 (System.Byte* dest, System.Byte* src, Int32 size)
    System.String.memcpy (System.Byte* dest, System.Byte* src, Int32 size)
    (wrapper unknown) Kinect.ColorBuffer:PtrToStructure (intptr,object)
    KinectSensor.extractColorImage (Kinect.NuiImageBuffer buf) (at Assets/Kinect/KinectSensor.cs:259)
    KinectSensor.Kinect.KinectInterface.pollColor () (at Assets/Kinect/KinectSensor.cs:212)
    DisplayColor.Update () (at Assets/Kinect/DisplayColor.cs:22)

    The line is:

    ColorBuffer cb = (ColorBuffer)Marshal.PtrToStructure(buf.m_pBuffer,typeof(ColorBuffer));

    Can anyone help me out?

     

    Anyone created the the Google Group? I can join?

     

    Cheers,

    Felipe Fragoso

  • User profile image
    AkhmadMax

    Thnx, Niranjan. I changed the paths and now it works, but only first time I running it in Unity. Trying run it second time Unity doesn't respond at all. I have no ideas to solve it.

    @fdfragoso: Hi, You said " Unity didnt crashed". What else you did besides changing paths.

    Thanks for any advice.

  • User profile image
    fdfragoso

    @AkhmadMax: I didnt do anything else. But after few days using, sometimes when I play the Unity crash, but sometimes works fine. Really dont know.

  • User profile image
    AAA

    i have an error in unity that it can't find MSRKINECTNUI.dll

    dllnot found exception

    i have beta2 installed
    can anyone help me

  • User profile image
    mayanktaneja

    Hi..

    The wrapper is awesome!! Just a quick question:

    I am completely new to unity. And I have to use it for integration of my 
    Kinect gesture recognition code with the 3d module of a car.  Please help 
    me as i am not able to find which script of C# to use for coding my module!! 
    Plus it would be great if you can also tell me how to integrate c# 
    and JavaScript because the car module is in JavaScript and kinect code is 
    in c#!! 

    Please reply as soon as possible!! Need it for my project in college!! 

    Thanks. 
    Mayank 

  • User profile image
    Dennis

    I'm using the Kinect SDK 1.0 (not beta) and Unity crashed every second time I ran my game. Here's how to fix it: http://www.rozengain.com/blog/2012/05/10/microsoft-kinect-sdk-wrapper-for-unity-crash-bug-fix/

  • User profile image
    gduncan411

    @Dennis:Nice, thanks for the write on this...

  • User profile image
    Wahooney

    Has anyone been able to get DisplayDepth and DisplayColor working in v1.x?

    I can get the bones working but I need the colour feedback too?

    Thanks.

  • User profile image
    mik

    Unfortunatelly depth and color don t work anymore:((((

    The plugin is not anymore updated?

  • User profile image
    THIBAULT David

    Hello,
    I wonder which device is compatible with KinectSDK-Unity3D_Interface_Plugin ?
    The XBOX360 kinect (http://emea.microsoftstore.com/UK/en-GB/Microsoft/Xbox-+-Games/Xbox-360-Kinect) or the Windows Kinect (http://emea.microsoftstore.com/UK/en-GB/Microsoft/Kinect-for-Windows)?

    Thanks.

  • User profile image
    gduncan411

    @THIBAULT David: The only fully supported device is the Kinect for Windows device.

  • User profile image
    Stevie Giovanni

    has anyone succeeded on using the color image? i tried to use the kinect sdk provided in the link but i keep getting cannot find dll MSRKINECTNUI.dll although i've given the correct path.

  • User profile image
    Steven Hickson

    I just hacked it to work with the SDK 1.5 version.
    It was just a matter of rewrapping the c++ SDK with a DLL and changing a little C# in KinectInterop.cs

    If anyone wants the DLL and C# that work with V1.5. Feel free to e-mail me at me@stevehickson.com

  • User profile image
    DyegoMaas

    @Steven Hickson: I tried e-mail you, but your mail server refuses it. 
    Maybe you could share your version of the wrapper by other means.

    I'm sure it can be very useful for a lot of people.

    Thank you.

     

  • User profile image
    milton ortiz

    i have a question maybe a little offset the main topic.
    how can i use the samples from kinect browser kit (face tracking) inside unity3d? thanks a lot

  • User profile image
    arrezes

    hi,

    Just started thinking of embarking my new project using kinect and unity. I have downloaded Kinect SDK 1.5 since this version is compatible with Kinect XBox sensor, I am using VC# Express 2010. Toolbox also downloaded. How about Unity? Does the free version workable for this? or I need to consider spending my money for Unity 4.

     

  • User profile image
    gduncan411

    Re-opening the comments...

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.