Accord.Video.Kinect.KinectNative.freenect_set_tilt_degs C# (CSharp) 메소드

freenect_set_tilt_degs() 개인적인 메소드

private freenect_set_tilt_degs ( IntPtr device, double angle ) : int
device System.IntPtr
angle double
리턴 int
        public static extern int freenect_set_tilt_degs(IntPtr device, double angle);

Usage Example

예제 #1
0
        /// <summary>
        /// Set motor's tilt value.
        /// </summary>
        ///
        /// <param name="angle">Tilt value to set, [-31, 30] degrees.</param>
        ///
        /// <exception cref="ArgumentOutOfRangeException">Motor tilt has to be in the [-31, 31] range.</exception>
        /// <exception cref="DeviceErrorException">Some error occurred with the device. Check error message.</exception>
        ///
        public void SetMotorTilt(int angle)
        {
            lock (sync)
            {
                CheckDevice();

                // check if value is in valid range
                if ((angle < -31) || (angle > 31))
                {
                    throw new ArgumentOutOfRangeException("angle", "Motor tilt has to be in the [-31, 31] range.");
                }

                int result = KinectNative.freenect_set_tilt_degs(rawDevice, angle);
                if (result != 0)
                {
                    throw new DeviceErrorException("Failed setting motor tilt. Error code: " + result);
                }
            }
        }