ofTheo / ofxKinect

legacy openFrameworks wrapper for the xbox kinect (OF pre-0.8.0+ only) - ofxKinect is now included and is being maintained in OF releases
MIT License
540 stars 105 forks source link

second kinect id must be set with dual setup #74

Closed kamend closed 13 years ago

kamend commented 13 years ago

I noticed that, if you try to use two kinects, you have to set the Id of the second kinect, when opening.. so kinect2.open(), should be kinect2.open(1) in order to work properly. Keep up the good work guys!

danomatika commented 13 years ago

Actually, it should open the first available id. As in:

kinect1.open();
kinect2.open();

Should open id 0 and 1 automatically ... Is this not working for you? Please test.

kamend commented 13 years ago

It is not working for me and I think I know where the problem is.

in bool ofxKinectContext::open(ofxKinect& kinect, int id) , you use nextAvailableId() to get the next ID and in nextAvailableId() you check if kinects.size() is more then 2, but kinects is updated at the end of the open(), so when calling the second kinect2.open(), kinects.size is still 1 and the nextAvailableId returns 0. Hope that make sense :)

danomatika commented 13 years ago

Ja, ok. Thanks for checking that. I'll fix it.

danomatika commented 13 years ago

Ok, I removed the min number check and tested with 2 kinects. It's working for me. Please update and test.

kamend commented 13 years ago

Working fine here too!