roymacdonald / kinectToTexturedOBJ

class to save the data from the kinect as a textured OBJ file.
24 stars 12 forks source link

Thread 1 error #1

Open matthewepler opened 12 years ago

matthewepler commented 12 years ago

My build succeeds, but the application icon bounces in my dock without actually opening. XCode console reports "ofxOpenNIDevice[0]: OF_LOG_ERROR: setGeneratorResolution() called on invalid generator! (lldb)," and it highlights a section of code in the addons > ofxOpenNI > include > openni > XnCppWrapper.h file with a message tag reading "Thread 1: EXC_BAD_ACCESS (code=2, address=0x0)."

I've uploaded a screen-grab of what is going on here: http://itp.nyu.edu/~mae383/thread1_error.mov

Using of_0071, XCode 4, 10.6 Base SDK and Default Apple LLVM compiler 3.1, Native Archicture

roymacdonald commented 12 years ago

Hi Matthew, did you add an oni recording and correctly linked it in the following line https://github.com/roymacdonald/kinectToTexturedOBJ/blob/master/src/testApp.cpp#L14 in my code that means that I have the "test0.oni" file inside the app's data folder (I can't watch again your video to check it, an "ITP page not found" appears but as I can recall there was nothing else than the openNI stuff within your data folder). The error code would make sense if the file is missing. also, you need to copy from addons/ofxOpenNI/examples/opeNI-SimpleExamples/bin/data/openni/config to your apps bin/data/openNI folder. This isn't the cause of this particular error but might be later. let me know how it goes on.

matthewepler commented 12 years ago

Your latest code updates are a big help. I wasn't getting that dialog box before. One major question - the ONI file that is required - should this be a pre-recorded file created separately from your program before compiling your code? Or just an empty file with the .oni extension? I'm getting the same error after following your suggestions above. I tried looking for instructions on creating an empty ONI file but the forums seem to suggest the only way to make one is by creating an actual recording.

roymacdonald commented 12 years ago

hi, yes you need a recording. the oni file must be created before you execute my code. there's a oni recorder example within ofxOpenNI. You can use it to create the recording. NO, the .oni file cant be empty. It contains the kinects recorded data. I'll implement a recording function within my code. It shouldn't be any trouble. Check my repo latter today for it. Cheers

matthewepler commented 12 years ago

Awesome. As a small note - the current experimental branch for OpenNI requires that you modify the ofxOpenNI.h file in order to launch the recorder correctly. I just made a recording, now to try your code...

https://github.com/gameoverhack/ofxOpenNI/issues/13

matthewepler commented 12 years ago

Works great!!!! Awesome work. Unless I'm missing it somewhere, I don't see an option for setting a depth threshold (so as to separate the subject from the rest of the room. I'm going to look at how RGBDToolkit is doing it and see if I can't add that in. Also might look at the different options OpenNI's recorder has for point clouds vs. meshes. This is so much fun. You're the man.

roymacdonald commented 12 years ago

Great! Theres nothing implemented to set the depth threshold but ofxopeni has a method to do so, so it should be really straight forward to implement. Openni doesnt have options to save neither pointclouds or meshes. When it records data it does it as images, which can then be processed to be shown as pointclouds or meshes. Have fun!

Roy Macdonald 8248-8478

On 09-07-2012, at 13:25, Matthew Epler reply@reply.github.com wrote:

Works great!!!! Awesome work. Unless I'm missing it somewhere, I don't see an option for setting a depth threshold (so as to separate the subject from the rest of the room. I'm going to look at how RGBDToolkit is doing it and see if I can't add that in. Also might look at the different options OpenNI's recorder has for point clouds vs. meshes. This is so much fun. You're the man.


Reply to this email directly or view it on GitHub: https://github.com/roymacdonald/kinectToTexturedOBJ/issues/1#issuecomment-6853336

heaversm commented 12 years ago

Hey guys - I started with the same issue as Matt - but I haven't managed to fix it as resourcefully as he has. I'm using the experimental branch of openni, and I've copied both the bin > data > openni > lib folder and the bin > data > openni > config folder. I have an ONI file made with the recorder example (in processing, not oF), and when I launch the project, it allows me to select the ONI file. But then I get this:

ofxOpenNIDevice[0]: OF_LOG_WARNING: Using a NASTY hack to silence SIGNAL errors on exit - read the comments at line ~1712 of ofxOpenNI.cpp ofxOpenNIDevice[0]: OF_LOG_NOTICE: Init context... ofxOpenNIDevice[0]: OF_LOG_NOTICE: openni driver version: 1.5.4.0 ofxOpenNIDevice[0]: OF_LOG_NOTICE: Adding licence... ofxOpenNIDevice[0]: OF_LOG_NOTICE: Init device... ofxOpenNIDevice[0]: OF_LOG_NOTICE: Found1devices connected ofxOpenNIDevice[0]: releasing device ofxOpenNIDevice[0]: OF_LOG_NOTICE: Starting ONI player:/Users/staff/Websource/Processing/libraries/SimpleOpenNI/examples/OpenNI/RecorderPlay/data/test.oni ofxOpenNIDevice[0]: OF_LOG_NOTICE: Starting ofxOpenNI with threading ofxOpenNIDevice[0]: OF_LOG_NOTICE: Adding generator typeXN_NODE_TYPE_DEPTH ofxOpenNIDevice[0]: OF_LOG_WARNING: Can't addXN_NODE_TYPE_DEPTH - there is already a generator of this type and you can only have one ofxOpenNIDevice[0]: OF_LOG_NOTICE: Adding generator typeXN_NODE_TYPE_IMAGE ofxOpenNIDevice[0]: OF_LOG_WARNING: Can't addXN_NODE_TYPE_IMAGE - there is already a generator of this type and you can only have one

Is there anything else I need to be doing to get this to run?

roymacdonald commented 12 years ago

Hi, try using the app with your kinect disconected. Also make sure that you've quited any other app that might use the kinect. as for the log info you pasted it looks like something of such nature. If, the problem remains, try running ofxOpenNI examples.

cheers!

heaversm commented 12 years ago

No luck. On a fresh reboot, I get the same errors. The ofxOpenNI examples from the master branch work fine - the ones from the experimental branch build successfully and throw no errors, but just bounce in the dock and become unresponsive. I may be building them improperly - the process on that wasn't clear in the readme, and seems to involve renaming your src folders.

roymacdonald commented 12 years ago

Hi, there seems to be a problem with some of the last commits to ofxOpenNI. I'm experimenting the same issues because I updated to the most recent version of ofxOpenNI.

Just as a quick work around, you can change the following line https://github.com/roymacdonald/kinectToTexturedOBJ/blob/master/src/testApp.cpp#L32 to openNI[deviceID].setup(false);

That will run ofxOpenNI in a non threaded mode.

roymacdonald commented 12 years ago

ok, as there's no fix for this so far in ofxOpenNi, go to ofxOpenNI.cpp, search for lock(mutex) and replace by lock()

this should fix this issue.

BTW, this is for osx only.

cheers.

heaversm commented 12 years ago

Hey Roy - the (mutex) replacement did not fix the issue, but running in non-threaded mode did work. Thanks! If there are any developments on the multithreaded issue, let me know.

roymacdonald commented 12 years ago

that's weird. make sure that you can run the examples from ofxOpenNI's experimental. try using a previous commit. If you're not used to git just click the following link and download the zip. https://github.com/gameoverhack/ofxOpenNI/tree/d7f14a7712306e4bba363a75dc0ceefbe87a9aec