Search Unity

Kinect/PS with OpenNI 2

Discussion in 'Assets and Asset Store' started by roumenf, Dec 17, 2013.

  1. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
  2. alvaro-em

    alvaro-em

    Joined:
    Feb 23, 2012
    Posts:
    77
    Hello.

    I have just downloaded the Unity package and I am trying to set it up on my mac, but I haven't found any installation instructions. I have downloaded openni and nite and uncompressed both tars. Could you please point me about what should I do next? The pdf doesn't tell anything about this platform. I have also read that I need to set a couple of environment vars. How can I do it?

    If there is any documentation for this platform I would appreciate if you could tell me where it is, since I have been unable to find it.

    Thank you very much in advance and kind regards.
     
    Last edited: Dec 17, 2013
  3. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    Hello Alvaro,

    Sorry for this. I'll add MacOS-related instructions to Readme-Kinect-OpenNI2.pdf. Here are some:

    As you know, on MacOS you can unpack OpenNI2 and NiTE2 archives whereever you want. That's why the REDIST-environment variables need to be set, and point to the Redist-subfolders of the unpacked OpenNI2 and NiTE2 packages. That way the Unity-wrapper will know where to find the needed packages. It would be best, if you set these variables into /etc/launchd.conf file and then restart your Mac. After that, if you run Terminal and type 'set' you should see the REDIST-variables along the other environment variables. After that you should be able to run the OpenNI2/NiTE examples, and Unity-wrapper example too.

    Also, keep in mind that there is no generic OpenNI2-Kinect-driver for MacOS (yet). If this is your case, you'd need to take further steps and install Freenect and OpenNI2-FreenectDriver. For other sensors, like PrimeSense Carmine, everything should work as is, without taking further steps.

    Cheers, Rumen
     
  4. alvaro-em

    alvaro-em

    Joined:
    Feb 23, 2012
    Posts:
    77
    Thank you! I will give it a try!

    Regards,
     
  5. loir

    loir

    Joined:
    May 28, 2013
    Posts:
    4
    Hello,

    I am really excited to use Kinect with Unity on the mac, but am too new to this to understand where the /etc/launchd.conf file is and how to set the environment variables. Please help. I've been searching for more detailed information, but haven't found it yet. I've downloaded everything, have used Terminal to install OpenNI 2, brought in the freekinect lib but still can't run the example scene in Unity. Thanks in advance for your help.

    Loir
     
  6. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    Hi Lori,

    please see 'How to install OpenNI2/Nite on MacOS X'-section here: http://rfilkov.com/2013/12/16/kinectps-with-openni-2/
    You need to open the Terminal-app, find the file and use a text-editor with admin rights to set these variables. Sorry for this, but it's not so easy to get OpenNI/NiTE working under MacOS X :)

    Greetings!
     
  7. Rindi

    Rindi

    Joined:
    Jan 24, 2014
    Posts:
    1
    Hello Roumen,

    I'm using your Unity Package and its work great. After reading KinectWrapper script, I only found several OpenNI/NiTE function.
    I need to measure user body proportion and to do that I need something like distance between user pixel (most right shoulder pixel - most left shoulder pixel) in meter. Is it can be done by existing function in KinectWrapper?

    Thank you very much in advance

    Kind Regards,
    Rindi
     
  8. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    Hi Rindi,

    Yes, you can measure the distance between joints (as Kinect sees them), in meters. I would only suggest that you use KinectManager instead of KinectWrapper. The code in your script should be something like this:

    KinectManager manager = KinectManager.Instance;
    if(manager manager.IsInitialized() manager.IsUserDetected())
    {
    uint userId = manager.GetPlayer1ID();

    if(manager.IsJointPositionTracked(userId, KinectWrapper.SkeletonJoint.LEFT_SHOULDER) manager.IsJointPositionTracked(userId, KinectWrapper.SkeletonJoint.RIGHT_SHOULDER))
    {
    Vector3 leftShoulderPos = manager.GetJointPosition(userId, KinectWrapper.SkeletonJoint.LEFT_SHOULDER);
    Vector3 rightShoulderPos = manager.GetJointPosition(userId, KinectWrapper.SkeletonJoint.RIGHT_SHOULDER);

    Vector3 leftToRight = rightShoulderPos - leftShoulderPos;
    float leftToRightDist = leftToRight.magnitude;
    // do something with the distance
    }
    }
    As the Kinect joints are not at the most right/most left position of the shoulders, you can add 0.1-0.2 meters to this value, after you test the returned value with your own shoulder distance, and on 2-3 others.
    Hope this helps.

    Greetings!
     
  9. gilab

    gilab

    Joined:
    Dec 6, 2013
    Posts:
    2
    Hi Rumen,

    FYI: I tried the package (it's nice!) with Kinect XBOX 360 on Windows 7. I managed to make it work after reading the OpenNI forum (the same but shorter). The Microsoft Kinect for Windows SDK also has to be installed (I tried 1.6, it worked). Additionally, it only worked for me when I did NOT install the Primesense driver while installing the OpenNI SDK.

    Best regards
     
    Last edited: Apr 17, 2014
  10. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    Hi gilab,

    Thank you for this feedback! I really appreciate researches, try outs and feedback like yours, because OpenNI2/NiTE2 installation and configurations to work with various sensors are tricky. One could not try out everything. I will put this info also on my blog, if you don't mind.

    Greetings and thanks again!
     
  11. gilab

    gilab

    Joined:
    Dec 6, 2013
    Posts:
    2
    Sure, feel free to share it.

    Greetings

    ps: We are very thankful to people who put these kind of packages in the asset store for free :)
     
  12. xmaurox

    xmaurox

    Joined:
    Apr 5, 2013
    Posts:
    10
    Hi! Where i can download OpenNI2 and NiTE2? The openni website is dead. Thanks!
     
  13. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
  14. xmaurox

    xmaurox

    Joined:
    Apr 5, 2013
    Posts:
    10
    Thanks a lot! But do you have around also NiTE2?
     
  15. xmaurox

    xmaurox

    Joined:
    Apr 5, 2013
    Posts:
    10
  16. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    No idea. Unfortunately NiTE2 is not an open source (as far as I remember), and also property of PrimeSense. Which was acquired and shut down by Apple :(
     
  17. xmaurox

    xmaurox

    Joined:
    Apr 5, 2013
    Posts:
    10
    I tried to follow instruction here:

    http://franciscobernardo.wordpress.com/2014/03/26/building-openni2-stack-for-kinect-on-mac-os-x/

    but with no good results. :-\
    These are my steps:


    - Unzip the file “OpenNI-MacOSX-x64-2.2.0.33.tar” and “NiTE-MacOSX-x64-2.2.tar”;
    - Setting the 2 variables in “/etc/launchd.conf” and reboot. So, now my “launchd.conf” is this:

    setenv OPENNI2_REDIST /Users/Mauro/Desktop/OpenNI-MacOSX-x64-2.2/Redist
    setenv NITE2_REDIST /Users/Mauro/Desktop/NiTE-MacOSX-x64-2.2/Redist

    - I installed libfreenect using mac port;

    So, now that's the part that i don’t understand a lot.

    I downloaded OpenNI2-FreenctDriver from here:

    https://github.com/OpenKinect/libfreenect/tree/master/OpenNI2-FreenectDriver

    and i installed make.
    I followed the steps that i have found in github repository, but after done “make” command, i don’t see these 3 files:

    libFreenectDriver.1.2.1.dylib
    libFreenectDriver.dylib
    libFreenectDriver.1.dylib

    Anyone have the same problem or can explain me which are the right steps for all this stuff?

    I also downloaded those 3 files from this link:

    https://code.google.com/p/simple-openni/downloads/list

    but when i run the project in Unity, i received a “SIGILL” error. :-\

    Thanks a lot!
     
  18. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
  19. xmaurox

    xmaurox

    Joined:
    Apr 5, 2013
    Posts:
    10
    Thanks roumenf. I tried... but nothing. Yes, i have Kinect for Xbox360. I used many times for installations but not with Unity... so, usually it works. But can you run the example in Unity? If yes, could you put in dropbox all the openNi and NiTE folders? :)
     
  20. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    Yes, running Kinect with OpenNI/Nite + Unity und OSX is not easy, but for the first time I have a SIGILL-case. The only Unity-peculiarity is that it needs 32-bit compilations of the native packages (universal builds). First, check the steps, as shown here: http://rfilkov.com/2013/12/16/kinectps-with-openni-2/

    If everything is done as described, do as follows:
    1. Go to the root folder of your Unity project (the folder containing Assets-folder). There must be a text file named OpenNI.ini
    2. Open the file and modify these lines: 'Verbosity=0' and 'LogToFile=1'. Save and close the file.
    3. Open the Unity project and run the scene. You will get the error again. Close the scene (if you can).
    4. Now there must be a Log-directory in your root folder and a log-file in it. Check it out to see what eventually went wrong.

    Hope this info helps. I'll try to ask another user that recently installed the packages under MacOS X help you.

    Greetings,
    Rumen
     
  21. slb073000

    slb073000

    Joined:
    Apr 1, 2014
    Posts:
    1

    Hello,

    I had trouble getting it running initially as well. The way I solved it was to uninstall everything and then redo all of the installation steps over again. The main things I did differently was to use Homebrew to install the freenect drivers, this ensured everything was installed. Also, after I reinstalled everything, I deleted my old Unity project, made a new one, reimported Rumen's plug-in and attempted to run the avatar demo. That time it worked.

    Also, after you've changed the launchd.conf file, you need to restart your computer for the changes to take effect. You can use the ‘printenv’ in your terminal to see if everything is pointing to the right direction. I hope this helps. Good luck!
     
  22. xmaurox

    xmaurox

    Joined:
    Apr 5, 2013
    Posts:
    10
    Finally i resolved!!! Thanks a lot for the support! :)
    So... i write what i did, really it was very simple (now that i know it :))
    First i removed MacPorts. If anybody need help, this is the link i found: https://guide.macports.org/chunked/installing.macports.uninstalling.html
    After i removed also Homebrew: http://apple.stackexchange.com/questions/82807/how-to-cleanly-remove-homebrew
    And i reinstall it: ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
    And after all this, i redid all the steps of the rfilkov website and all works without problems! I didn't need to build a universal dylib, so it was easy. :)
     
  23. juancvv

    juancvv

    Joined:
    May 19, 2014
    Posts:
    3
    Hi, I have the the demo in unity and works grate. thanks
    is there Development Documentation where?
    is there a whay to control the Tilt motor?

    Thanks
     
  24. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    Hi,

    To your questions:
    1. No, there is no detailed development documentation available. But there are hints and tips in the Readme-file and some tutorials in the Assets-folder of the Unity package. Apart of there there are working example scenes with scripts that you can use directly or modify for your needs + many comments in the code. Generally you'd need to call/use the public methods of KinectManager in your script, so concentrate on researching the examples, as to your needs.

    2. No, you can't tilt the Kinect-sensor via OpenNI, but only manually, as far as I know.

    Greetings!
     
  25. g__b

    g__b

    Joined:
    Sep 17, 2014
    Posts:
    39
    hello, and thanx for your work.
    I am on OSX 10.8.5, Kinect for XBOX v.1473.
    I followed your instructions but I cannot make the native OpenNI2/NiTE2 examples work.
    Obviously the Unity project doesn't work too, I have this error:

    System.Exception: Error initing OpenNI: DeviceOpen using default: no devices found

    This is what i found in the Log:

    Fallback handler could not load library /Applications/Unity/Unity.app/Contents/Frameworks/Mono/lib/UnityInterface2


    Where to find the source to build the universal dylib for the OpenNI2-Kinect driver?

    Thank you again
     
  26. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
  27. Abaobao

    Abaobao

    Joined:
    Oct 8, 2013
    Posts:
    7
    Hi,
    I want to know is it play well on KinectV2?
     
  28. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    If you mean the OpenNI2-package, probably not, unless you have a Kinect2-driver for OpenNI2.
     
  29. psynusoidal

    psynusoidal

    Joined:
    May 26, 2015
    Posts:
    14
    Hi,

    Unfortunately I am running into an issue with this as well. It seems that no matter what I do I can't get the libUnityInterface.dylib library to load. I even tried setting up an explicit <dllmap> rule in Unity's mono config to make sure the DllImports in KinectWrapper were looking in the right place.

    The exact error is:
    I'm using Unity 5.0.2 on OS X 10.10.3.

    I've been reading that this might be caused by the library not being compiled with universal binary support, or potentially by it being compiled with universal binary support when it should only be 32bit... (yes I've read both, I guess os x is tricky indeed.. lol) I would attempt to rebuild the library myself but it appears the source code is no longer available :(

    Anyway, I'd really love to be able to get up and running with this and any help would be greatly appreciated.

    Thanks!

    Edit:

    So after some more messing around I was able to _sort of_ get things working. My main issue was that I accidentally set the wrong paths for the NiTE and OpenNI redist directories. Once I got those straightened out I was able to get the demo scenes working but **only** if I published a build; it will not work in play mode within the editor and will continue to throw DllNotFoundExceptions. I'm still new to unity so I don't know if this is to be expected or some sort of bug or what... but at least it's something.
     
    Last edited: May 26, 2015
  30. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    Do you run Unity Editor 32-bit or 64-bit? Please contact me by e-mail, if you like to get the source of the UnityInterface2.dll. Then you can try to compile it on your Mac, hence to see what might be causing the in-editor issue.
     
  31. psynusoidal

    psynusoidal

    Joined:
    May 26, 2015
    Posts:
    14
    Thanks for the quick response!

    As far as I know Unity 5 for OS X is 64-bit only (according to https://unity3d.com/unity/whats-new/unity-5.0). Seems to support the case that it might just need to be rebuilt as a universal binary.

    I've sent you an email, hopefully we can get this all sorted out :)
     
  32. psynusoidal

    psynusoidal

    Joined:
    May 26, 2015
    Posts:
    14
    Flamacore and roumenf like this.
  33. TPZC

    TPZC

    Joined:
    Sep 24, 2012
    Posts:
    5
    [UPDATE]
    It works now, but still not in the editor. I will probably need a 64bit version of the UnityInterface2.dll
    ----


    Does anyone know how to get it running on PC with Unity 5?

    I keep getting the error: "OpenNI directrory not found. Please check the OpenNI installation".

    Everything works in the old version.
     
    Last edited: Jun 26, 2015
  34. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    Yes, it works with Unity 5 32-bit. At the time of this asset release Unity was 32-bit only. I will provide x64 support soon, but if you're in a hurry please contact me by e-mail.
     
  35. TPZC

    TPZC

    Joined:
    Sep 24, 2012
    Posts:
    5
    Hi,

    Is it possible in an easy way to turn off the auto calibration, and use the T-Pose calibration instead?
    Thanks a lot for your help in advance!

    Regards Tom
     
  36. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    Yes. The T-pose needs to be added to the list of detected gestures and then used as calibration pose (resolved by e-mail).
     
  37. Iknow21

    Iknow21

    Joined:
    Oct 31, 2015
    Posts:
    2
    Hi, I seem to be having an issue getting Kinect working on Mac OS Unity. I've made sure the Kinect is connected to my machine, however when running the GesturesDemo scene, in the bottom right corner all that is being shown is a grey square; while in the AvatarDemo, Unity freezes during the loading process and I have to force quit afterwards.

    I've checked the log file, and usually the last thing called seems to be:

    "--- Filter Info --- Minimum Severity: VERBOSE
    2102593 VERBOSE xnUSB XnLinuxUSB.cpp 379 Initializing USB...
    4103771 INFO xnUSB XnLinuxUSB.cpp 407 USB is initialized.
    4114490 INFO Log XnLog.cpp 349 New log started on 2015-10-31 22:07:59
    4114521 INFO Log XnLog.cpp 322 --- Filter Info --- Minimum Severity: VERBOSE
    4114535 VERBOSE xnUSB XnLinuxUSB.cpp 379 Initializing USB...
    6117348 INFO xnUSB XnLinuxUSB.cpp 407 USB is initialized.
    6119748 VERBOSE ALL OniContext.cpp 367 Trying to open device by URI '(NULL)'
    7099469 VERBOSE ALL OniContext.cpp 54 Initialize: Already initialized"

    Not particularly sure what this means, I would assume there wouldn't be a problem with multiple initializations, but the demo's do not seem to work regardless. Any advice on what I could do to fix this?
     
  38. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    Ohh, Mac OS is always tricky. As far as I see the log above, the Kinect sensor was not found at all. Please make sure you have copied the freenect Kinect driver to the OpenNI2 Drivers-folder and that OpenNI2 examples work. Follow the steps under 'How to Install OpenNI2 and NiTE2 on MacOS X' here: http://rfilkov.com/2013/12/16/kinectps-with-openni-2/
     
  39. profzeman

    profzeman

    Joined:
    Mar 31, 2013
    Posts:
    4
    I'm having the exact same problem with my Mac - the freenect-glview works just fine, but the two example scenes provided either hang up Unity completely (The Avatar scene) or just never get any info from the Kinect at att (Gestures Demo). I also enabled my log and got the exact same result as lknow21. Has anyone gotten Mac OS to work with this yet? And if so what version of the OSx are you using?
     
  40. mrselfdestruct

    mrselfdestruct

    Joined:
    Dec 23, 2013
    Posts:
    3
    hi roumen! first of all: respect and thank you very much for your efforts regarding kinect & mac os x support.

    after trying out a while i managed to launch the avatar gesture demo in unity editor 5.3 on mac os x el capitan. i also followed the instructions by user "psynusoidal" above.

    it runs, the only problem i have is the following: unity 5.3 crashes every first time i play the scene. after reopening unity and starting the scene again, it works fine, but when i stop the scene, the unity editor crashes again. when i make a built, it's the same, every second attempt succeeds. do you have any suggestions how to solve this problem? (my build settings: mac os x, x32_x64).

    and could you explain a bit more where to put the libunityinterface2 and where to get it exactly?

    here is the log:

    4460 INFO Log XnLog.cpp 349 New log started on 2016-01-19 17:48:16
    4484 INFO Log XnLog.cpp 322 --- Filter Info --- Minimum Severity: VERBOSE
    4509 VERBOSE OniContext OniContext.cpp 144 No override device in configuration file
    4531 VERBOSE OniContext OniContext.cpp 155 Configuration has been read from '/Users/digi/Desktop/kinect open ni/kinect open ni/OpenNI.ini'
    4537 VERBOSE OniContext OniContext.cpp 162 OpenNI 2.2.0 (Build 33)-MacOSX (Nov 12 2013 16:14:14)
    4542 VERBOSE OniContext OniContext.cpp 170 Extending the driver path by '/Library/OpenNI-MacOSX-x64-2.2/Redist/OpenNI2/Drivers', as configured in file '/Users/digi/Desktop/kinect open ni/kinect open ni/OpenNI.ini'
    4546 VERBOSE OniContext OniContext.cpp 184 Using '/Library/OpenNI-MacOSX-x64-2.2/Redist/OpenNI2/Drivers' as driver path
    4551 VERBOSE OniContext OniContext.cpp 207 Looking for drivers in drivers repository '/Library/OpenNI-MacOSX-x64-2.2/Redist/OpenNI2/Drivers'
    59700 INFO OniDeviceDriver OniDeviceDriver.cpp 139 Device connected: Microsoft Kinect (freenect://0)
    59725 INFO OniDeviceDriver OniDeviceDriver.cpp 156 Device state changed: Microsoft Kinect (freenect://0) to 0
    61139 INFO OniDeviceDriver OniDeviceDriver.cpp 139 Device connected: Microsoft Kinect (freenect://0)
    61149 INFO OniDeviceDriver OniDeviceDriver.cpp 156 Device state changed: Microsoft Kinect (freenect://0) to 0
    61282 WARNING xnOS XnLinuxSharedLibs.cpp 60 Failed loading lib: dlopen(/Library/OpenNI-MacOSX-x64-2.2/Redist/OpenNI2/Drivers/libFreenectDriver.dylib, 2): no suitable image found. Did find:
    /Library/OpenNI-MacOSX-x64-2.2/Redist/OpenNI2/Drivers/libFreenectDriver.dylib: mach-o, but wrong architecture

    61295 VERBOSE OniContext OniContext.cpp 246 Couldn't use file 'libFreenectDriver.dylib' as a device driver
    66863 INFO Log XnLog.cpp 349 New log started on 2016-01-19 17:48:16
    66883 INFO Log XnLog.cpp 322 --- Filter Info --- Minimum Severity: VERBOSE
    66894 VERBOSE xnUSB XnLinuxUSB.cpp 379 Initializing USB...
    68042 INFO xnUSB XnLinuxUSB.cpp 407 USB is initialized.
    70540 INFO Log XnLog.cpp 349 New log started on 2016-01-19 17:48:16
    70555 INFO Log XnLog.cpp 322 --- Filter Info --- Minimum Severity: VERBOSE
    70566 VERBOSE xnUSB XnLinuxUSB.cpp 379 Initializing USB...
    71756 INFO xnUSB XnLinuxUSB.cpp 407 USB is initialized.
    74068 WARNING DriverHandler OniDriverHandler.cpp 51 LibraryHandler: Couldn't find function oniDriverCreate in libUnityInterface2.dylib. Stopping
    74083 VERBOSE OniContext OniContext.cpp 246 Couldn't use file 'libUnityInterface2.dylib' as a device driver
    74104 VERBOSE OniContext OniContext.cpp 389 Trying to open device by URI '(NULL)'
    4378791 VERBOSE OniContext OniContext.cpp 56 Initialize: Already initialized
    48169476 INFO OniContext OniContext.cpp 286 Shutdown: still need 1 more shutdown calls (to match initializations)
     
  41. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    Thank you for the feedback. Kinect+Unity on Mac is more than a challenge. I even gave up once and deprecated this asset, but then decided to put it back and, if possible, find out what goes wrong there. To find out why Unity crashes, I would need to take a look at the Editor.log. You can find it at this location: ~/Library/Logs/Unity/Editor.log. Please send it to me, or post it here.

    In the log above, the initial error is: "Failed loading lib: dlopen(/Library/OpenNI-MacOSX-x64-2.2/Redist/OpenNI2/Drivers/libFreenectDriver.dylib, 2): no suitable image found. Did find: /Library/OpenNI-MacOSX-x64-2.2/Redist/OpenNI2/Drivers/libFreenectDriver.dylib: mach-o, but wrong architecture"

    libUntyInterface2.dylib is not a driver, but the native library that provides the bridge between OpenNI2/NiTE2 and Unity. When the Unity scene starts for a first time, this library along with some OpenNI/NiTE libraries and config-files are copied to the root-folder of your Unity project, as far as I remember. Do you think it will be easier, if I share the sources of this library on GitHub for instance, so that everyone interested could build it and eventually fix bugs in it?
     
  42. mrselfdestruct

    mrselfdestruct

    Joined:
    Dec 23, 2013
    Posts:
    3
    hi rouman, thx for the fast reply. i deleted everything in the log to start fresh, restarted unity 5.3 with your asset:

    the first load of the ni-2 unity project resulted in a working scene, but when i pressed play again to stop the scene, unity crashed.

    the second load resulted in an instant crash when i hit "play" to run the scene.

    here is the editor.log: http://piratepad.net/wDvLbBEIJ4

    as far as i can say: unity program crashes alway happen when i hit "play" and try to stop the working scene. instant crashes, when i hit play to start the scene happen every second time i reopen unity.

    about the libUnityInterface2.dylib: i think it would be great if you share the sources of the library on GitHub.

    thanx again for your time and efforts rouman and i really think that it is important to make it run on mac too, many (wannabe-) nerds are grateful for this i guess!

    many greetings from austria
     
    Last edited: Jan 20, 2016
  43. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    Here is the Git-repo of UnityInterface2-library - https://github.com/rfilkov/OpenNi2UnityInterface

    As far as I see from the Editor.log, the crash is caused by a FreenectDriver-generated exception. I suppose the reason may be that it was not closed correctly at the end of the previous run and then this causes exception on the 2nd one. Then, it is probably auto-closed by the OS, and then the sequence repeats again. I will check (as soon as I find time), if UnityInterface2-library shuts down the OpenNI2-system correctly, but will appreciate it, if someone else takes a look, too.

    By the way, my name is Rumen, not rouman. Traditional Bulgarian name, sorry :)
     
  44. mrselfdestruct

    mrselfdestruct

    Joined:
    Dec 23, 2013
    Posts:
    3
    hi ruman (sorry for the typo^^), thank you very much for your time and efforts and great you've uploaded the library. greetings
     
    roumenf likes this.
  45. ashokbugude

    ashokbugude

    Joined:
    Feb 10, 2016
    Posts:
    20
    Hi I am using windows 10 and unity 5.3 in 32 bit .I have installed the OPENNI2 and NITE2 .But when I run in unity I get
    below error.Pls help

    System.Exception: NiTE2 directory not found. Please check the NiTE installation.
    at KinectWrapper.CheckOpenNIPresence () [0x001df] in C:\Users\Ashok\Documents\openSourceTest\Assets\KinectScripts\KinectWrapper.cs:407
    at KinectManager.Awake () [0x00000] in C:\Users\Ashok\Documents\openSourceTest\Assets\KinectScripts\KinectManager.cs:627
    UnityEngine.Debug:LogError(Object)
    KinectManager:Awake() (at Assets/KinectScripts/KinectManager.cs:640)


    System.DllNotFoundException: UnityInterface2
    at (wrapper managed-to-native) KinectWrapper:Init (bool,bool,bool)
    at KinectManager.Start () [0x00000] in C:\Users\Ashok\Documents\openSourceTest\Assets\KinectScripts\KinectManager.cs:655
    UnityEngine.Debug:LogError(Object)
    KinectManager:Start() (at Assets/KinectScripts/KinectManager.cs:805)
     
  46. ashokbugude

    ashokbugude

    Joined:
    Feb 10, 2016
    Posts:
    20
    I am able to solve the above issues by restarting the system.

    Now the only error I face is as below. Can I know if it works with Kinect v1 ? .
    I have connected xbox360 . Is it mandatory to install Kinect sdk ? I already installed the Prime sense drivers .
    Kinect sdk doesn't get installed in Linux . So is it possible to run the project with xbox




    System.Exception: Error initing OpenNI: DeviceOpen using default: no devices found

    at KinectManager.Start () [0x0001e] in C:\Users\Ashok\Documents\openSourceTest\Assets\KinectScripts\KinectManager.cs:658
    UnityEngine.Debug:LogError(Object)
    KinectManager:Start() (at Assets/KinectScripts/KinectManager.cs:811)
     
  47. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    I’m not sure why you use the 32-bit version of Unity. The problem before was that Unity was 32-bit only, which also required 32-bit installations of OpenNI2/NiTE2. The error you get means that either Unity was open when you installed the frameworks, or that it can’t lookup the environment variables, telling where exactly the OpenNI2/NiTE2 were installed. You can set these paths manually in CheckopenNIPresence()-function of KinectWrapper.cs.
     
  48. roumenf

    roumenf

    Joined:
    Dec 12, 2012
    Posts:
    635
    First off, please research a bit more. You see, you can overcome most of the issues by yourself. This issue is more difficult though. On Windows, for Kinect-for-Xbox, the Kinect SDK had to be install, in order OpenNI2-Kinect driver to work. For Linux – I don’t know. Research the Linux Kinect/OpenNI2-related forums, to see if there is a solution to that. Then you can try to run the OpenNI2/NiTE2-samples, too.
     
  49. masterchop

    masterchop

    Joined:
    Oct 9, 2015
    Posts:
    39
    I tried this in Ubuntu now that we have Linux support for unity but i was not succesful, could you please help me out?>?? i just hate windows and its super slowness but i am force by kinect :( I am able to run openNi2 already, NiViewer2 works fine but cant use it in unity.
     
    roumenf likes this.
  50. RHD

    RHD

    Joined:
    Mar 30, 2009
    Posts:
    719
    Hi, huge thanks to everyone for all the information here and roumenf for providing the asset for free.

    Does it matter which kinect hardware you are trying to connect to a Mac?

    Thank you.