OSDN Git Service

GMIN-2992: Enable filtering on accelerometer and gyroscope
authorPatrick Porlan <patrick.porlan@intel.com>
Wed, 20 Aug 2014 17:30:30 +0000 (19:30 +0200)
committerAdriana Reus <adriana.reus@intel.com>
Wed, 3 Sep 2014 07:53:38 +0000 (10:53 +0300)
Cts Verifier is frequently failing the gyro tests because it's very
sensitive to out of spec samples. Filtering the BMG160 output makes
it happy, so let's enable filtering on other sensor types than just
magnetometer. We may want to tune filter latency though.

Issue: GMIN-2992

Change-Id: I0cbea2195a616ffd922c67246d04d0af8619398c
Signed-off-by: Patrick Porlan <patrick.porlan@intel.com>
transform.c

index 4bd72c9..e86fe1a 100644 (file)
@@ -254,6 +254,8 @@ static int finalize_sample_default(int s, struct sensors_event_t* data)
 
        switch (sensor_type) {
                case SENSOR_TYPE_ACCELEROMETER:
+                       if (sensor_info[s].quirks & QUIRK_NOISY)
+                               denoise(&sensor_info[s], data, 3);
                        break;
 
                case SENSOR_TYPE_MAGNETIC_FIELD:
@@ -265,6 +267,8 @@ static int finalize_sample_default(int s, struct sensors_event_t* data)
                case SENSOR_TYPE_GYROSCOPE:
                case SENSOR_TYPE_GYROSCOPE_UNCALIBRATED:
                        calibrate_gyro(data, &sensor_info[s]);
+                       if (sensor_info[s].quirks & QUIRK_NOISY)
+                               denoise(&sensor_info[s], data, 3);
                        break;
 
                case SENSOR_TYPE_LIGHT: