none
How to refactor KinectSensor GetDefault RRS feed

  • Question

  • I'm needing to run two kinects for a display piece I'm working on. Unfortunately the KinectSensor.Sensors was removed after Kinect SDK 1.0 so all we have access to is KinectSensor.GetDefault which returns the computer's "default" kinect. How can I refactor "GetDefault" to allow me to pass in a device id as a parameter?

    Monday, June 10, 2019 4:55 PM

Answers

  • In case you want to use two Kinects on one machine, it can't be done. It's not supported by the SDK, which is why KinectSensor.Sensors which returned multiple sensors got replaced with GetDefault which returns just one. In case you want to have two of them connected while changing the one being used, I also don't think it's possible since it's not just the application you're writing that's been changed to operate with just once sensor, but the KinectService as well. KinectService grabs the raw input from the sensor and processes them(via GPU mostly) and prepares them in the way the SDK gives them to the end-user developer for use in their own applications.

    So basically it's not just one operating sensor out of many on one machine, but really only one sensor per machine.

    I don't think it's possible for you to rewrite it. The part of the code that does that is probably inside the closed source dll. The way to do approach such a scenario is only through multiple machines with Kinects and some kind of peer2peer or client server setup.

    Monday, June 10, 2019 5:24 PM