Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
//busy = false;
// limit raw depth to 25 fps
if (Date.now() > sentTime + 40) {
packageData("rgbd", rgbdImg);
sentTime = Date.now();
}
setTimeout(function() {
busy = false;
});
}); // kinect.on
} // open
kinect.openMultiSourceReader({
frameTypes: Kinect2.FrameType.depth | Kinect2.FrameType.depthColor
});
}
currentFrames = frames;
// TO DO Simplify the case and result per Shawn
for (var j = 0; j < frames.length; j++) {
var frameName;
var tempName;
frameName = frames[j];
switch (frameName) {
case "color":
multiFrames.push(Kinect2.FrameType.color);
break;
case "depth":
multiFrames.push(Kinect2.FrameType.depth);
break;
case "body":
multiFrames.push(Kinect2.FrameType.body);
break;
case "raw-depth":
multiFrames.push(Kinect2.FrameType.rawDepth);
break;
// case 'bodyIndexColor':
// multiFrames.push(Kinect2.FrameType.bodyIndexColor);
// break;
// case 'depthColor':
// multiFrames.push(Kinect2.FrameType.depthColor);
var frameName;
var tempName;
frameName = frames[j];
switch (frameName) {
case "color":
multiFrames.push(Kinect2.FrameType.color);
break;
case "depth":
multiFrames.push(Kinect2.FrameType.depth);
break;
case "body":
multiFrames.push(Kinect2.FrameType.body);
break;
case "raw-depth":
multiFrames.push(Kinect2.FrameType.rawDepth);
break;
// case 'bodyIndexColor':
// multiFrames.push(Kinect2.FrameType.bodyIndexColor);
// break;
// case 'depthColor':
// multiFrames.push(Kinect2.FrameType.depthColor);
// break;
//infrared is not implemented for multiframe yet
// case 'infrared':
switch (frameName) {
case "color":
multiFrames.push(Kinect2.FrameType.color);
break;
case "depth":
multiFrames.push(Kinect2.FrameType.depth);
break;
case "body":
multiFrames.push(Kinect2.FrameType.body);
break;
case "raw-depth":
multiFrames.push(Kinect2.FrameType.rawDepth);
break;
// case 'bodyIndexColor':
// multiFrames.push(Kinect2.FrameType.bodyIndexColor);
// break;
// case 'depthColor':
// multiFrames.push(Kinect2.FrameType.depthColor);
// break;
//infrared is not implemented for multiframe yet
// case 'infrared':
// multiFrames.push(Kinect2.FrameType.infrared);
// break;
// case 'le-infrared':
return;
}
// Set global frames variable for use in preview message
currentFrames = frames;
// TO DO Simplify the case and result per Shawn
for (var j = 0; j < frames.length; j++) {
var frameName;
var tempName;
frameName = frames[j];
switch (frameName) {
case "color":
multiFrames.push(Kinect2.FrameType.color);
break;
case "depth":
multiFrames.push(Kinect2.FrameType.depth);
break;
case "body":
multiFrames.push(Kinect2.FrameType.body);
break;
case "raw-depth":
multiFrames.push(Kinect2.FrameType.rawDepth);
break;
// case 'bodyIndexColor':
// multiFrames.push(Kinect2.FrameType.bodyIndexColor);
showHeight(outputContext, joint, jointDistanceFromFloor);
//send height data to remote
var jointDataToSend = {joint: joint, distance: jointDistanceFromFloor};
sendToPeer('floorHeightTracker', jointDataToSend);
}
}
}
trackedBodyIndex = closestBodyIndex;
busy = false;
});
kinect.openMultiSourceReader({
frameTypes: Kinect2.FrameType.body | Kinect2.FrameType.color
});
}
}
showHeight(outputContext, joint, jointDistanceFromFloor);
//send height data to remote
var jointDataToSend = {joint: joint, distance: jointDistanceFromFloor};
sendToPeer('floorHeightTracker', jointDataToSend);
}
}
}
trackedBodyIndex = closestBodyIndex;
busy = false;
});
kinect.openMultiSourceReader({
frameTypes: Kinect2.FrameType.body | Kinect2.FrameType.color
});
}
}