/// <summary> /// Dispose resources /// </summary> public void Dispose() { if (Motor != IntPtr.Zero) { CLNUIDevice.DestroyMotor(Motor); } Motor = IntPtr.Zero; if (Camera != IntPtr.Zero) { CLNUIDevice.DestroyCamera(Camera); } Camera = IntPtr.Zero; DeviceId = 0; }
/// <summary> /// Constructor /// </summary> /// <param name="deviceid">Device id</param> public Kinect(int deviceid) { // freenect.Kinect k = new freenect.Kinect(0); try { DeviceId = deviceid; Motor = CLNUIDevice.CreateMotor(Serial); Camera = CLNUIDevice.CreateCamera(Serial); SetMotorPosition(0); } catch (Exception e) { Trace.WriteLine("[Kinect] : Constructor failure : " + e.Message); } }
/// <summary> /// /// </summary> /// <param name="level"></param> public void SetMotorPosition(short level) { CLNUIDevice.SetMotorPosition(Motor, level); }
/// <summary> /// Set /// </summary> /// <param name="mode"></param> public void SetLED(KinectLedBlinkMode mode) { CLNUIDevice.SetMotorLED(Motor, (byte)mode); }