How to gracefully close/exit/delete/finish/? a SimpleOpenNI context and then create a new context?

Visto 62 veces
Saltar al primer mensaje no leído

Tracy Collins

no leída,
9 ene 2014, 15:49:549/1/14
a simple-ope...@googlegroups.com
I'm trying to write a sketch where I record Kinect data to an .oni file, and then switch modes to playback the just recorded data.

The problem that I'm having seems to be that there's no way to gracefully shutdown the Kinect context between recording and playing back or vice-versa.

I've tried context.close(), context.delete(), context.finish() and just re-instantiating(?) it like: "context = new SimpleOpenNI(this, fileName);"   It seems that the previous context does not release the Kinect, so that the new context returns the error "SimpleOpenNI Error: Can't open device: ..."

Thoughts?

thanks,
t

Tomasz Osiecki

no leída,
16 abr 2016, 16:04:2116/4/16
a simple-openni-discuss
I have the same problem. Is way to close SimpleOpenNI context and intialize it again in another PApplet, but in the same application?

My programs starts and I have to options to pick from: record or play. Both of them are PApplets. This one which I choose as first always run without problem, but when I try to pick another(after disposing first JFrame and destroy PApplet) I have error:

Exception in thread "Animation Thread" java.lang.NullPointerException
at menu_processing.RecordSketchKinect.setup(RecordSketchKinect.java:52)
at processing.core.PApplet.handleDraw(PApplet.java:2361)
at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:240)
at processing.core.PApplet.run(PApplet.java:2256)
at java.lang.Thread.run(Unknown Source)


Anyone can help?

Thanks in advance
Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos