Make ao_flight_test show AGL altitude and positive acceleration under boost
[fw/altos] / ao_flight_test.c
index a94fc7402c6ad4ab143486961e88c16aed0b0048..0b03eb1f59c3f24fb39490ee8bd3ba9017590489 100644 (file)
@@ -240,10 +240,10 @@ ao_dump_state(void)
                return;
        printf ("\t\t\t\t\t%s accel %g vel %g alt %d main %d\n",
                ao_state_names[ao_flight_state],
-               (ao_flight_accel - ao_ground_accel) / COUNTS_PER_G * GRAVITY,
+               (ao_ground_accel - ao_flight_accel) / COUNTS_PER_G * GRAVITY,
                (double) ao_flight_vel / 100 / COUNTS_PER_G * GRAVITY,
-               ao_pres_to_altitude(ao_flight_pres),
-               ao_pres_to_altitude(ao_main_pres));
+               ao_pres_to_altitude(ao_flight_pres) - ao_pres_to_altitude(ao_ground_pres),
+               ao_pres_to_altitude(ao_main_pres) - ao_pres_to_altitude(ao_ground_pres));
        if (ao_flight_state == ao_flight_landed)
                exit(0);
 }