From a97ead75db11ce7dcaa0d3a598fb2de805d30d2d Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Wed, 19 Jan 2011 14:26:25 -0800 Subject: fix [3369027] Sensor.TYPE_ROTATION_VECTOR is unstable and returns NaNs when running slowly The cut-off frequency of the lowpass filter was too high for the sampling rate used by DELAY_NORMAL. Now we use the same filters used for the gravity vector (cascaded biquad at 1.5 Hz) Change-Id: Iac290a716cc47a78337a8f0e45b103e49b4d9d78 --- services/sensorservice/RotationVectorSensor.cpp | 4 ++-- services/sensorservice/RotationVectorSensor.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'services') diff --git a/services/sensorservice/RotationVectorSensor.cpp b/services/sensorservice/RotationVectorSensor.cpp index 418e7f8..3abfc12 100644 --- a/services/sensorservice/RotationVectorSensor.cpp +++ b/services/sensorservice/RotationVectorSensor.cpp @@ -34,9 +34,9 @@ static inline T clamp(T v) { RotationVectorSensor::RotationVectorSensor(sensor_t const* list, size_t count) : mSensorDevice(SensorDevice::getInstance()), - mALowPass(M_SQRT1_2, 5.0f), + mALowPass(M_SQRT1_2, 1.5f), mAX(mALowPass), mAY(mALowPass), mAZ(mALowPass), - mMLowPass(M_SQRT1_2, 2.5f), + mMLowPass(M_SQRT1_2, 1.5f), mMX(mMLowPass), mMY(mMLowPass), mMZ(mMLowPass) { for (size_t i=0 ; i