-
Notifications
You must be signed in to change notification settings - Fork 895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sharing device between applications still possible? #31
Comments
Hi, It is no longer a feature of OpenNI / NiTE. If on your specific configuration you want to have two applications running together, your options are:
|
Ah well, time to find a workaround then. So if both apps are merged into one, somewhere in the Nite-based module there will be a usertracker.create() call, and somewhere in the ONI-based module there will be something that opens up a VideoStream from the device. Will this be allowed to work, because they are both running in the same process (albeit in different threads)? Or will it fail? |
I think you can achieve your goal by the following structure: I suppose this configuration allows you to consume the same data from one depth stream by two modules. |
Actually, User Tracker takes a device, not a depth stream. One thing to note tough in such a configuration, is that if you need a video mode other than the default one, you should set it to the depth stream before creating the User Tracker. |
Oops, my bad. Thank you for correction.
So, the general programming guideline might be "The application needs to know that the video mode and other sensor properties may be shared between multiple streams of the same type spawned from the same device. The application is responsible for setting them up in the right order without conflict" or something, I suppose. |
Okay, I think I got how to do it now. In the past few days I have wondered if sharing within the same application could be made easier with, say, a ReadOnlyDevice class, which would publicly inherit from Device, and which behaves pretty much the same as a Device, but prevents any setter operations (after initialization) that could cause conflicts - for compatibility maybe it could implement them but throw an exception. There would also need to be a way for a class user to determine the ReadOnlyDevice's current configuration at runtime before registering itself, then, if it's cool with the config, it can proceed, and if not then it can refuse to connect. |
A couple of comments:
|
I've done a cursory scan of the repo and docs for anything similar to the 'Sharing Devices Between Applications and Locking Nodes' functionality from OpenNI 1.5, but can't find anything. Does OpenNI2 still have a mode for sharing a single device between multiple applications?
More specifically, I am looking to run an OpenNI2-based application and a NiTE2-based application simultaneously, both fed by the same Kinect.
The text was updated successfully, but these errors were encountered: