altos: Baro-only boards must not detect launch on accel or speed data
authorKeith Packard <keithp@keithp.com>
Sat, 19 Mar 2011 19:28:08 +0000 (12:28 -0700)
committerKeith Packard <keithp@keithp.com>
Sat, 19 Mar 2011 19:28:08 +0000 (12:28 -0700)
The baro sensor generates too much noise to use small changes in
computed speed or acceleration to cause a false launch detect.

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

index e8130baab3070d54cb40a05adc88554508ff6b44..71dd4891669523b130f1ad2681f1ca54abc78b0f 100644 (file)
@@ -488,9 +488,20 @@ ao_flight(void)
                         * transition is detected
                         */
 #if USE_KALMAN
                         * transition is detected
                         */
 #if USE_KALMAN
+#if HAS_ACCEL
+                       /*
+                        * With an accelerometer, either to detect launch
+                        */
                        if ((ao_k_accel > to_fix32(20) &&
                             ao_k_speed > to_fix32(5)) ||
                            ao_k_height > to_fix32(20))
                        if ((ao_k_accel > to_fix32(20) &&
                             ao_k_speed > to_fix32(5)) ||
                            ao_k_height > to_fix32(20))
+#else
+                       /*
+                        * Without an accelerometer, the barometer is far too
+                        * noisy to rely on speed or acceleration data
+                        */
+                       if (ao_k_height > to_fix32(20))
+#endif
 #else
                        if (
 #if HAS_ACCEL
 #else
                        if (
 #if HAS_ACCEL