예제 #1
0
 public void SetServoCalibration(int servoID, ServoCalibration servoCalibration)
 {
     Set <int?>(GetServoSettingID(servoID, "MinRange"), servoCalibration.MinRange);
     Set <int?>(GetServoSettingID(servoID, "MaxRange"), servoCalibration.MaxRange);
     Set <float?>(GetServoSettingID(servoID, "ServoLinearization"), servoCalibration.ServoLinearization);
     Set <float?>(GetServoSettingID(servoID, "ServoOffset"), servoCalibration.ServoOffset);
     Set <float?>(GetServoSettingID(servoID, "FeedbackLinearization"), servoCalibration.FeedbackLinearization);
     Set <float?>(GetServoSettingID(servoID, "FeedbackOffset"), servoCalibration.FeedbackOffset);
     Set <int?>(GetServoSettingID(servoID, "MaxSpeed"), servoCalibration.MaxSpeed);
 }
예제 #2
0
        public ServoCalibration GetServoCalibration(int servoID)
        {
            var result = new ServoCalibration();

            result.MinRange              = Get <int?>(GetServoSettingID(servoID, "MinRange")).GetValueOrDefault();
            result.MaxRange              = Get <int?>(GetServoSettingID(servoID, "MaxRange")).GetValueOrDefault();
            result.ServoLinearization    = Get <float?>(GetServoSettingID(servoID, "ServoLinearization")).GetValueOrDefault();
            result.ServoOffset           = Get <float?>(GetServoSettingID(servoID, "ServoOffset")).GetValueOrDefault();
            result.FeedbackLinearization = Get <float?>(GetServoSettingID(servoID, "FeedbackLinearization")).GetValueOrDefault();
            result.FeedbackOffset        = Get <float?>(GetServoSettingID(servoID, "FeedbackOffset")).GetValueOrDefault();
            result.MaxSpeed              = Get <int?>(GetServoSettingID(servoID, "MaxSpeed")).GetValueOrDefault();

            return(result);
        }