public static BodyTracker Create(Calibration sensorCalibration)
        {
            AzureKinectException.ThrowIfNotSuccess(
                BodyTrackingNativeMethods.k4abt_tracker_create(sensorCalibration, out BodyTrackingNativeMethods.k4abt_tracker_t handle));

            return(new BodyTracker(handle));
        }
            public k4abt_frame_t DuplicateReference()
            {
                k4abt_frame_t duplicate = new k4abt_frame_t();

                BodyTrackingNativeMethods.k4abt_frame_reference(handle);
                duplicate.handle = this.handle;
                return(duplicate);
            }
 public UInt32 GetBodyId(UInt32 index)
 {
     lock (this)
     {
         if (disposedValue)
         {
             throw new ObjectDisposedException(nameof(BodyFrame));
         }
         return(BodyTrackingNativeMethods.k4abt_frame_get_body_id(handle, index));
     }
 }
        public static BodyTracker Create(Calibration sensorCalibration)
        {
            AzureKinectException.ThrowIfNotSuccess(
                BodyTrackingNativeMethods.k4abt_tracker_create(sensorCalibration, new TrackerCalibration
            {
                sensor_orientation = SensorOrientation.K4ABT_SENSOR_ORIENTATION_DEFAULT,
                cpu_only_mode      = 0
            }, out BodyTrackingNativeMethods.k4abt_tracker_t handle));

            return(new BodyTracker(handle));
        }
 public Skeleton GetSkeleton(UInt32 index)
 {
     lock (this)
     {
         if (disposedValue)
         {
             throw new ObjectDisposedException(nameof(BodyFrame));
         }
         BodyTrackingNativeMethods.k4abt_frame_get_body_skeleton(handle, index, out Skeleton skeleton);
         return(skeleton);
     }
 }
        public void EnqueueCapture(Capture capture, int timeoutInMS = -1)
        {
            lock (this)
            {
                if (disposedValue)
                {
                    throw new ObjectDisposedException(nameof(Device));
                }

                NativeMethods.k4a_wait_result_t result = BodyTrackingNativeMethods.k4abt_tracker_enqueue_capture(handle, capture.DangerousGetHandle(), timeoutInMS);

                if (result == NativeMethods.k4a_wait_result_t.K4A_WAIT_RESULT_TIMEOUT)
                {
                    throw new TimeoutException("Timed out waiting for capture");
                }

                AzureKinectException.ThrowIfNotSuccess(result);
            }
        }
        public BodyFrame PopResult(int timeoutInMS = -1)
        {
            lock (this)
            {
                if (disposedValue)
                {
                    throw new ObjectDisposedException(nameof(Device));
                }

                NativeMethods.k4a_wait_result_t result = BodyTrackingNativeMethods.k4abt_tracker_pop_result(handle, out BodyTrackingNativeMethods.k4abt_frame_t frame, timeoutInMS);

                if (result == NativeMethods.k4a_wait_result_t.K4A_WAIT_RESULT_TIMEOUT)
                {
                    throw new TimeoutException("Timed out waiting for capture");
                }

                AzureKinectException.ThrowIfNotSuccess(result);

                return(new BodyFrame(frame));
            }
        }
 protected override bool ReleaseHandle()
 {
     BodyTrackingNativeMethods.k4abt_frame_release(handle);
     return(true);
 }
 protected override bool ReleaseHandle()
 {
     BodyTrackingNativeMethods.k4abt_tracker_destroy(handle);
     return(true);
 }