Пример #1
0
        public void AddMeasurement(IBandAccelerometerReading reading)
        {
            _numMeasPoints++;
            var acc = new Vector(reading.AccelerationX, reading.AccelerationY, reading.AccelerationZ);
            if (_numMeasPoints < 10)
            {
                _calibrationValues.Add(acc);
                return;
            }
            if (_numMeasPoints == 10)
            {
                _calibrationValue = 1.0 / _calibrationValues.AverageValue;
                _calibrationValues = null;

                Debug.WriteLine($"Calibrated to {_calibrationValue}");
            }

            _lastAccValue = acc.Multiply(9.81 * _calibrationValue);
            //Debug.WriteLine($"Acc: {acc}, value: {acc.Value}");
        }
Пример #2
0
        public void AddMeasurement(IBandAccelerometerReading reading)
        {
            _numMeasPoints++;
            var acc = new Vector(reading.AccelerationX, reading.AccelerationY, reading.AccelerationZ);

            if (_numMeasPoints < 10)
            {
                _calibrationValues.Add(acc);
                return;
            }
            if (_numMeasPoints == 10)
            {
                _calibrationValue  = 1.0 / _calibrationValues.AverageValue;
                _calibrationValues = null;

                Debug.WriteLine($"Calibrated to {_calibrationValue}");
            }

            _lastAccValue = acc.Multiply(9.81 * _calibrationValue);
            //Debug.WriteLine($"Acc: {acc}, value: {acc.Value}");
        }