Exemple #1
0
        protected long SampleInterval;                                    // interval between samples in microseonds

        protected ImuSensor(SensorFusion fusion)
        {
            Fusion = fusion;

            AxisRotation = new AxisRotation();

            for (int i = 0; i < 3; i++)
            {
                _magMax[i] = -1000.0;
                _magMin[i] = 1000.0;
            }
        }
		protected long SampleInterval;                            // interval between samples in microseonds

		protected ImuSensor(SensorFusion fusion)
		{
			Fusion = fusion;

			AxisRotation = new AxisRotation();

			for (int i = 0; i < 3; i++)
			{
				_magMax[i] = -1000.0;
				_magMin[i] = 1000.0;
			}
		}
Exemple #3
0
        private void PerformAxisRotation(ref SensorReadings readings)
        {
            if (readings.GyroValid)
            {
                readings.Gyro = AxisRotation.Rotate(readings.Gyro);
            }

            if (readings.AccelerationValid)
            {
                readings.Acceleration = AxisRotation.Rotate(readings.Acceleration);
            }

            if (readings.MagneticFieldValid)
            {
                readings.MagneticField = AxisRotation.Rotate(readings.MagneticField);
            }
        }