Hi community,
I want to update an old project using kinect1 sensor with a KinectV2.
Since KinectV2 only works in windows, I am doing everything on Win 10.
Right now I receive the sensor's data using this small OSC utility https://github.com/microcosm/KinectV2-OSC
The data looks like this:
print: /bodies/72057594037928550/joints/Head 0.321555 -0.0569061 0.743229 Inferred
The ID is changing everytime when a user enter the field of view / or more than one user are present in the field of view.
I need only one user ID, the clothest. So I need to make a function that route the body ID and keep it as long as his head posZ is smaller than other users ID head posZ.
Here is an attempt, I did a little vanilla Kinect data simulator. If somebody can take a look and give any hint it would be very nice 
Cheers

. Do you know beforehand the complete set of possible IDs? I'm assuming from your description and example that each ID may go in and out of range, so when you say you want the closest one, do you mean the closest one that's still in range? And I gather from your example that an ID is in-range when you've received an OSC message from it within the last 100 ms, is that right?

