This project is read-only.

Bugs in Gesture Viewer Sample

Apr 16, 2012 at 12:31 AM

Everything runs for me but things are not working as well as they could be

  • The code for the Record button seems to have a bug.  When you hit stop recording, the code immediately starts recording again (see below).  Is that desired? It was confusing for me.
private void recordOption_Click(object sender, RoutedEventArgs e)
        {
            if (recorder != null)
            {
                StopRecord();
               //NEED TO ADD RETURN HERE//
            }

            SaveFileDialog saveFileDialog = new SaveFileDialog { Title = "Select filename", Filter = "Replay files|*.replay" };

            if (saveFileDialog.ShowDialog() == true)
            {
                DirectRecord(saveFileDialog.FileName);
            }
        }
  • The View Depth button is blocking the posture recognition strings at the top of the window on my monitor.
  • The lack of feedback when recording is started by audio left me confused for a bit.
  • When I exit the application by closing it I sometimes get this exception:
System.InvalidOperationException was unhandled
  Message=This API has returned an exception from an HRESULT: 0x80070015
  Source=Microsoft.Kinect
  StackTrace:
       at Microsoft.Kinect.KinectExceptionHelper.CheckHr(Int32 hr)
       at Microsoft.Kinect.KinectSensor.MapDepthToColorImagePoint(DepthImageFormat depthImageFormat, Int32 depthX, Int32 depthY, Int16 depthPixelValue, ColorImageFormat colorImageFormat)
       at Microsoft.Kinect.KinectSensor.MapSkeletonPointToColor(SkeletonPoint skeletonPoint, ColorImageFormat colorImageFormat)
       at Kinect.Toolbox.Tools.Convert(KinectSensor sensor, SkeletonPoint position) in C:\Code\KinectToolbox\Tools.cs:line 86
       at Kinect.Toolbox.SkeletonDisplayManager.GetCoordinates(JointType jointType, IEnumerable`1 joints, Single& x, Single& y) in C:\Code\KinectToolbox\SkeletonDisplayManager.cs:line 28
       at Kinect.Toolbox.SkeletonDisplayManager.Plot(JointType centerID, IEnumerable`1 joints) in C:\Code\KinectToolbox\SkeletonDisplayManager.cs:line 39
       at Kinect.Toolbox.SkeletonDisplayManager.Draw(ReplaySkeletonFrame frame) in C:\Code\KinectToolbox\SkeletonDisplayManager.cs:line 128
       at GesturesViewer.MainWindow.ProcessFrame(ReplaySkeletonFrame frame) in C:\Code\KinectToolbox\GesturesViewer\MainWindow.xaml.cs:line 242
       at GesturesViewer.MainWindow.kinectRuntime_SkeletonFrameReady(Object sender, SkeletonFrameReadyEventArgs e) in C:\Code\KinectToolbox\GesturesViewer\MainWindow.xaml.cs:line 204
       at Microsoft.Kinect.ContextEventHandler`1.SendOrPostDelegate(Object state)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.DispatcherOperation.InvokeImpl()
       at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
       at System.Threading.ExecutionContext.runTryCode(Object userData)
       at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Windows.Threading.DispatcherOperation.Invoke()
       at System.Windows.Threading.Dispatcher.ProcessQueue()
       at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
       at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
       at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
       at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       at System.Windows.Application.RunDispatcher(Object ignore)
       at System.Windows.Application.RunInternal(Window window)
       at System.Windows.Application.Run(Window window)
       at System.Windows.Application.Run()
       at GesturesViewer.App.Main() in C:\Code\KinectToolbox\GesturesViewer\obj\x86\Debug\App.g.cs:line 0
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.IO.FileNotFoundException
       Message=The device is not ready. (Exception from HRESULT: 0x80070015)
       InnerException: