summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-01-16 15:57:15 -0800
committerKeith Packard <keithp@keithp.com>2011-01-16 20:24:13 -0800
commit1b8d7313504240ed04e0747e9b0f6e9a83d323e2 (patch)
tree35bbb21eaac8dcdca288aea68acc338500e7ba12
parentafd3d3cdb8c2291c1c7cda7908392d68cd04f87f (diff)
altos: Auto-calibrate linux-based flight testing code
Use the provided ground acceleration average to set the two accelerometer calibration values so that the flight code will detect pad/idle mode correctly. Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--src/ao_flight_test.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/ao_flight_test.c b/src/ao_flight_test.c
index e0cfa47a..108d2c19 100644
--- a/src/ao_flight_test.c
+++ b/src/ao_flight_test.c
@@ -238,6 +238,8 @@ ao_sleep(void *wchan)
switch (type) {
case 'F':
ao_flight_ground_accel = a;
+ ao_config.accel_plus_g = a;
+ ao_config.accel_minus_g = a + 530;
ao_flight_started = 1;
break;
case 'S':