We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I'm new to Processing and this forum so please bare with me as I find my way to the correct language and format for posting here. I am appreciative of any and all help I get as I begin working with this wonderful set of tools.
I am trying to get my Kinect setup to run with Processing. I think I have everything installed now, and I have run the kinect with glview after the last bit of installing with homebrew. I went into Processing (2.1) to try and run a simple depth image sketch to see that was all working. Here is the code:
import SimpleOpenNI.*;
SimpleOpenNI context;
void setup()
{
context = new SimpleOpenNI(this);
// enable depthMap generation
context.enableDepth();
// enable camera image generation
context.enableRGB();
background(200,0,0);
size(context.depthWidth() + context.rgbWidth() + 10, context.rgbHeight());
}
void draw()
{
// update the cam
context.update();
// draw depthImageMap
image(context.depthImage(),0,0);
// draw camera
image(context.rgbImage(),context.depthWidth() + 10,0);
}
I get this information with my "Can't run the sketch" Error:
SimpleOpenNI Version 1.96
After initialization:
send_cmd: Data buffer is 322 bytes long, but got 334 bytes
freenect_fetch_zero_plane_info: send_cmd read 334 bytes (expected 322)
freenect_camera_init(): Failed to fetch zero plane info for device
libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: Cannot open Kinect
Could not run the sketch (Target VM failed to initialize).
Make sure that you haven't set the maximum available memory too high.
I am running Processing 2.1 on a mac with 10.9.1 and a model 1473 Kinect. I have installed openkeinect with homebrew and as I said, I get a depth image and RGB image when I run glview in terminal. I have tried different memory settings in Processing between 250mb and 1024mb, and always get the same error message......
Any thoughts on how to get things running?
Answers
What version of simpleopenNI you are using?
Hi blyk, SimpleOpenNI version 1.96 is what I have running.
Are you familiar with this type of error? Is it a version problem?
hi chinyank, I just picked up a kinect yesterday. I have the same setup as you and I am getting the same error when trying to use with processing... please let me know if you get it working. and if I figure it out, I'll be sure to post here. cheers.
I have tried some other sketches as well. I am getting another error when using OpenKinect with the pointcloud example sketch, an error and a grey screen. Maybe the error text could be useful. Here it is:
java.lang.RuntimeException: java.lang.UnsatisfiedLinkError: /Users/Hulda/Documents/Processing/libraries/openkinect/library/libKinect.jnilib: dlopen(/Users/Hulda/Documents/Processing/libraries/openkinect/library/libKinect.jnilib, 1): no suitable image found. Did find: /Users/Hulda/Documents/Processing/libraries/openkinect/library/libKinect.jnilib: mach-o, but wrong architecture at com.jogamp.common.util.awt.AWTEDTExecutor.invoke(AWTEDTExecutor.java:58) at jogamp.opengl.awt.AWTThreadingPlugin.invokeOnOpenGLThread(AWTThreadingPlugin.java:103) at jogamp.opengl.ThreadingImpl.invokeOnOpenGLThread(ThreadingImpl.java:206) at javax.media.opengl.Threading.invokeOnOpenGLThread(Threading.java:172) at javax.media.opengl.Threading.invoke(Threading.java:191) at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:492) at processing.opengl.PJOGL.requestDraw(PJOGL.java:626) at processing.opengl.PGraphicsOpenGL.requestDraw(PGraphicsOpenGL.java:1598) at processing.core.PApplet.run(PApplet.java:2177) at java.lang.Thread.run(Thread.java:744) Caused by: java.lang.UnsatisfiedLinkError: /Users/Hulda/Documents/Processing/libraries/openkinect/library/libKinect.jnilib: dlopen(/Users/Hulda/Documents/Processing/libraries/openkinect/library/libKinect.jnilib, 1): no suitable image found. Did find: /Users/Hulda/Documents/Processing/libraries/openkinect/library/libKinect.jnilib: mach-o, but wrong architecture at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1965) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1894) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1880) at java.lang.Runtime.loadLibrary0(Runtime.java:849) at java.lang.System.loadLibrary(System.java:1088) at org.openkinect.Context.(Context.java:43) at org.openkinect.processing.Kinect.start(Kinect.java:40) at PointCloud.setup(PointCloud.java:44) at processing.core.PApplet.handleDraw(PApplet.java:2281) at processing.opengl.PJOGL$PGLListener.display(PJOGL.java:799) at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:590) at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:574) at javax.media.opengl.awt.GLCanvas$9.run(GLCanvas.java:1218) at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1036) at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:911) at javax.media.opengl.awt.GLCanvas$10.run(GLCanvas.java:1229) at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:241) at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:733) at java.awt.EventQueue.access$200(EventQueue.java:103) at java.awt.EventQueue$3.run(EventQueue.java:694) at java.awt.EventQueue$3.run(EventQueue.java:692) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76) at java.awt.EventQueue.dispatchEvent(EventQueue.java:703) at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242) at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138) at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Does this ring any bells for the folks out there......
Rebaxter, did you do the install with homebrew? I did, installed only what it requested. I have not installed anything more through terminal. I have wondered if I have missed something. Still when I run glview I get a nice RGB image and a spectral depth map. Terminal starts clicking away, but says "lost packets" every fifty lines or so, if that means anything to people here.
Call me stupid, or ill informed, but I just don't know what information is current. I have installed: xCode MacPorts (when I thought I had to...) Processing 2.1 Simple-OpenNI 1.96 (using the homebrew install) Openkinect (downloaded, put into ....Processing/Libraries, then installed library inside Processing)
What I have not installed: OpenNI SensorKinect NITE or anything else not included in in the homebrew build.
Is it so simple that I have misunderstood that OpenNI, SensorKinect, and NITE are still necessary to install separate from the homebrew build? Do I need to start over??!! :( Or can I just go and install these after all these first steps I've already done.
As you see I am confused, but it is hard to determine what information is current, and concurrent with the newest versions. I'll be so happy to have all this sorted out!
Ditto on chainyank's first post - same OS/Kinect model and I'm stumped. I'm sorry I have nothing to add...
Nryn, do you not have openNI, SensorKinect, and NITE either? I'm still curious if this is the problem, or if it is bigger than that. In any case, I know I'm not alone in this, thanks.
That model of the kinect doesn't work well with mac. I had a really hard time installing it and I got to the point of the camera working for 20 seconds and them freezes. I think some guys are working hard (thank you) on a fix for it but I still couldn't make it work https://github.com/ofTheo/libfreenect/commit/dfc66611be947ed788329c7fd907b84b5ea7d61a
I had the old version and it worked really well.
And I also think that now windows has released the sdk (but just for windows). Well, thinking on bootcamping my MBP to see if it works.
here you can see the 2 discussions going on about it:
https://github.com/OpenKinect/libfreenect/pull/325 https://github.com/OpenKinect/libfreenect/pull/361 - ofTheo says he actually fix it, but I still can't get it to work.
after libfreenect is fixed I think we will be able to fix the processing library.
Thanks Jonatas, I hope soon to get some hands-on help with this, and see if I can get it to work for me. Thank you for the links to the discussions and fixes. I'll get back with the results!
well I have updates. I got it to work on openframeworks with the ofTheo fix.
I think now we just need to compile the simpleOpenNI with the fixed version of libfreenect.
I'm not sure how to do it because I'm not an experience developer, but I'll try.
If I have any update I'll post it.
I've been watching this discussion for a while now and finally decided to give it a shot too... To say it upfront: I've managed to compile the simpleOpenNI library (under OSX 10.9.1 with a 1473 Kinect) and have been able to run some of the examples that come with the library in Processing... However, the whole thing seems to be still unstable and partially new error messages have arisen. Hereunder, I just depict the main steps that I have gone through to get it to this point, in case this could help:
A. freenect
I applied the ofTheo fix (including adding
keep_alive.c
to the list of files inCMakeLists.txt
)Generated with
cmake -DBUILD_OPENNI2_DRIVER=ON ..
to have the libFreenectDriver too.Compiled and installed it.
B. SimpleOpenNI-2.0
Downloaded the sources for
OpenNI-MacOSX-x64-2.2
,NiTE-MacOSX-x64-2.2
andeigen
(I'm not sure whether or not I recompiled them, and if I did, if it was really necessary. Sorry!). The other prerequisites for SimpleOpenNI where already met on my machine.Updated the file locations for these libs in the
buildOsx.sh
ofSimpleOpenNI-2.0
and changedCMAKE_OSX_ARCHITECTURES
attribute tox86_64
(removed thei386
)Changed the path to the processing.core in the
CMakeLists.txt
(line 166), removing the "Resources
" inSET(P5_JAR "/Applications/Processing.app/Contents/Resources/Java/core.jar")
. Note: When exploring the package contents of theProcessing.app
(2.1.1), the original path seemed not valid, but, not being a Java expert, I'm not sure if this really is a problem...In the directory
dist/all/SimpleOpenNI/library/osx/OpenNI2/Drivers
if have replacedlibfreenect.0.1.2.dylib
andlibFreenectDriver.dylib
withlibfreenect.0.3.0.dylib
andlibFreenectDriver.0.3.0.dylib
(copied it from thefreenect
build of step 'A'). Note: I'm sure there has to be a cleaner way, but I was too impatient to test it... Any suggestion would be welcome!Compiled and installed it (with
buildOsx.sh
andsudo installOsx.sh
).After this, the example
Hands3d.pde
and a few others worked. I hope to be able to spend some time on the not working examples soon...Hope these explanations were understandable and the results reproducible.
While I'm sad that others are having problems I'm glad to see that some of you can do something to fix it, and help those of us with less developing (read none) skills. I have now tried another (borrowed) Kinect model nr:1414 with the exact same libraries installed and it is working fine. I hope to try the above solution next week. I have begun working with someone with much higher level of skill with these sort of things though he is new to processing, so I hope to get some hands on help.
Hi, I have the same problem :( The solution from seppe seems to be useful, thanks! ... before I read you, I began an other discusion related the same problem:
http://forum.processing.org/two/discussion/3749/run-kinect-in-macos-10-9#Item_2
I think this link can be also useful: http://blog.nelga.com/setup-microsoft-kinect-on-mac-os-x-10-9-mavericks/
But I think, for first, I will avoid the kinect model 1473 ;) best mariana
I have the same issue on Mavericks. I am not very clear on the solution proposed. Could somebody please elaborate ?