Esempio n. 1
0
        /// <summary>
        /// Main realtive move method
        /// </summary>
        /// <param name="baseAngle"></param>
        /// <param name="distance"></param>
        /// <param name="z"></param>
        /// <returns></returns>
        public override async Task MoveToRelativeAsync(double baseAngle, double distance, double z)
        {
            VerticalServoPositions verticalServoPositions    = CalculateVerticalServoPositions(distance, z);
            ServoPositions         convertedServoAnglesOrPwm = ConvertToAbsoluteServoAnglesOrPwm(new ServoPositions(baseAngle, verticalServoPositions));

            await MoveToConvertedAnglesOrPwmAsync(convertedServoAnglesOrPwm);
        }
Esempio n. 2
0
        /// <summary>
        /// procedure for calculating servo angles for a position
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="z"></param>
        /// <returns></returns>
        private ServoPositions CalculateServosFromPosition(double x, double y, double z)
        {
            double angleBase = CalculateAngleOfBase(x, y);
            double distance  = CalcualteDistance(x, y);

            VerticalServoPositions verticalServoPositions = CalculateVerticalServoPositions(distance, z);

            return(new ServoPositions(angleBase, verticalServoPositions.Shoulder, verticalServoPositions.Elbow));
        }
Esempio n. 3
0
 public ServoPositions(double @base, VerticalServoPositions verticalServoPositions)
 {
     Base     = @base;
     Shoulder = verticalServoPositions.Shoulder;
     Elbow    = verticalServoPositions.Elbow;
 }