I’m trying to upgrade my Kinect SDK to the new version and having some troubles which I can’t figure why.
It breaks as soon as it reaches kinectSensor.SkeletonFrameReady += this.KinectAllFramesReady;
private KinectSensor kinectSensor;
public MainWindow()
{
InitializeComponent();
kinectSensor.SkeletonFrameReady += this.KinectAllFramesReady;
kinectSensor.SkeletonStream.Enable(new TransformSmoothParameters()
{
Smoothing = 0.5f,
Correction = 0.5f,
Prediction = 0.5f,
JitterRadius = 0.05f,
MaxDeviationRadius = 0.04f
});
kinectSensor.Start();
}
Already solved in the comments, but an answer is better for anyone with the same problem;
The problem with the code is that it declares the kinectSensor variable, but never sets it to anything. There’s a pretty good code example at MSDN Social on how to do detection of connected/disconnected devices, but a very simple version just to get started playing around is to just use the first entry in the static
KinectSensor.KinectSensorscollection which will be your first connected sensor.