From: Keith Packard Date: Sun, 16 Jan 2011 23:57:15 +0000 (-0800) Subject: altos: Auto-calibrate linux-based flight testing code X-Git-Tag: debian/0.8.1+71+gda42f40~1^2~5 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=1b8d7313504240ed04e0747e9b0f6e9a83d323e2 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 --- 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':