public SensorRangeImpl(SensorRange r, UInt16 commandId = 0) { SetSensorRange(r, commandId); }
public void GetSensorRange(out SensorRange r) { r = new SensorRange(); r.MaxAcceleration = AccelScale * 9.81f; r.MaxRotationRate = (float)(GyroScale * System.Math.PI / 180.0); r.MaxMagneticField= MagScale * 0.001f; }
public void SetSensorRange(SensorRange r, UInt16 commandId = 0) { CommandId = commandId; AccelScale = SelectSensorRampValue(AccelRangeRamp, r.MaxAcceleration, (1.0f / 9.81f), "MaxAcceleration"); GyroScale = SelectSensorRampValue(GyroRangeRamp, r.MaxRotationRate, (float)(180.0 / System.Math.PI), "MaxRotationRate"); MagScale = SelectSensorRampValue(MagRangeRamp, r.MaxMagneticField, 1000.0f, "MaxMagneticField"); Pack(); }