altos: Eliminate separate height error filter for accelerometer devices
authorKeith Packard <keithp@keithp.com>
Sun, 27 Aug 2017 23:57:13 +0000 (16:57 -0700)
committerKeith Packard <keithp@keithp.com>
Mon, 28 Aug 2017 00:40:40 +0000 (17:40 -0700)
We don't use the error value in flight for those models anyways; it's
only useful on baro-only hardware.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/kernel/ao_kalman.c

index d401a3c8ff5bd04a88c7dea0216d53abcd145589..87f1bf66f6147e372edad8a94513802aa11c1774 100644 (file)
@@ -96,13 +96,8 @@ ao_kalman_err_height(void)
                e = -e;
        if (e > 127)
                e = 127;
-#if HAS_ACCEL
-       ao_error_h_sq_avg -= ao_error_h_sq_avg >> 2;
-       ao_error_h_sq_avg += (e * e) >> 2;
-#else
        ao_error_h_sq_avg -= ao_error_h_sq_avg >> 4;
        ao_error_h_sq_avg += (e * e) >> 4;
-#endif
 
        if (ao_flight_state >= ao_flight_drogue)
                return;