summaryrefslogtreecommitdiff
path: root/src/ao_flight.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-08-13 23:58:03 -0700
committerKeith Packard <keithp@keithp.com>2011-08-13 23:58:03 -0700
commit709485f20fb039f8dd087c8491c5f5a76718ae53 (patch)
treef25ecefb6f013f426c4a337813b62245d4c862f5 /src/ao_flight.c
parentaa71c2cdcb417eba2a2d30792ece9a47b8b3fc82 (diff)
altos: use raw height while waiting for landing
This avoids any noise introduced by the kalman filter, making landing detection much more reliable. This patch also changes the interval to 10s so that the height bounds can be increased to 4m. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/ao_flight.c')
-rw-r--r--src/ao_flight.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ao_flight.c b/src/ao_flight.c
index af3d6bfa..85c1825b 100644
--- a/src/ao_flight.c
+++ b/src/ao_flight.c
@@ -54,7 +54,7 @@ __pdata uint8_t ao_flight_force_idle;
/* Landing is detected by getting constant readings from both pressure and accelerometer
* for a fairly long time (AO_INTERVAL_TICKS)
*/
-#define AO_INTERVAL_TICKS AO_SEC_TO_TICKS(5)
+#define AO_INTERVAL_TICKS AO_SEC_TO_TICKS(10)
#define abs(a) ((a) < 0 ? -(a) : (a))
@@ -286,7 +286,7 @@ ao_flight(void)
ao_interval_max_height = ao_avg_height;
if ((int16_t) (ao_sample_tick - ao_interval_end) >= 0) {
- if (ao_interval_max_height - ao_interval_min_height <= AO_M_TO_HEIGHT(2))
+ if (ao_interval_max_height - ao_interval_min_height <= AO_M_TO_HEIGHT(4))
{
ao_flight_state = ao_flight_landed;