projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos: Add nickle kalman implementation.
[fw/altos]
/
src
/
ao_flight.c
diff --git
a/src/ao_flight.c
b/src/ao_flight.c
index e8130baab3070d54cb40a05adc88554508ff6b44..493913b2c1b2a91732bde0fc9cbf407ee2609196 100644
(file)
--- a/
src/ao_flight.c
+++ b/
src/ao_flight.c
@@
-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
@@
-616,8
+627,10
@@
ao_flight(void)
/* slow down the telemetry system */
ao_telemetry_set_interval(AO_TELEMETRY_INTERVAL_RECOVER);
/* slow down the telemetry system */
ao_telemetry_set_interval(AO_TELEMETRY_INTERVAL_RECOVER);
+#if !USE_KALMAN
/* slow down the ADC sample rate */
ao_timer_set_adc_interval(10);
/* slow down the ADC sample rate */
ao_timer_set_adc_interval(10);
+#endif
/*
* Start recording min/max accel and pres for a while
/*
* Start recording min/max accel and pres for a while