altos/test: Parse mega ground data. Fix pyro parsing
authorKeith Packard <keithp@keithp.com>
Wed, 21 May 2014 21:00:05 +0000 (14:00 -0700)
committerKeith Packard <keithp@keithp.com>
Wed, 21 May 2014 21:01:27 +0000 (14:01 -0700)
This gets ao_flight_test_mega working with eeprom files

Signed-off-by: Keith Packard <keithp@keithp.com>
src/test/ao_flight_test.c

index 0abb4090d397e0a615ea1ca31a00288f7057d5a5..3995d98d199b721b8f1f1cf7be2737e40d320bb5 100644 (file)
@@ -732,6 +732,18 @@ ao_sleep(void *wchan)
                                        ao_flight_started = 1;
                                        ao_ground_pres = int32(bytes, 4);
                                        ao_ground_height = ao_pa_to_altitude(ao_ground_pres);
                                        ao_flight_started = 1;
                                        ao_ground_pres = int32(bytes, 4);
                                        ao_ground_height = ao_pa_to_altitude(ao_ground_pres);
+                                       ao_ground_accel_along = int16(bytes, 8);
+                                       ao_ground_accel_across = int16(bytes, 10);
+                                       ao_ground_accel_through = int16(bytes, 12);
+                                       ao_ground_roll = int16(bytes, 14);
+                                       ao_ground_pitch = int16(bytes, 16);
+                                       ao_ground_yaw = int16(bytes, 18);
+                                       ao_ground_mpu6000.accel_x = ao_ground_accel_across;
+                                       ao_ground_mpu6000.accel_y = ao_ground_accel_along;
+                                       ao_ground_mpu6000.accel_z = ao_ground_accel_through;
+                                       ao_ground_mpu6000.gyro_x = ao_ground_pitch >> 9;
+                                       ao_ground_mpu6000.gyro_y = ao_ground_roll >> 9;
+                                       ao_ground_mpu6000.gyro_z = ao_ground_yaw >> 9;
                                        break;
                                case 'A':
                                        ao_data_static.tick = tick;
                                        break;
                                case 'A':
                                        ao_data_static.tick = tick;
@@ -791,7 +803,7 @@ ao_sleep(void *wchan)
 
                                for (i = 2; i < nword; i++) {
                                        for (j = 0; j < NUM_PYRO_VALUES; j++)
 
                                for (i = 2; i < nword; i++) {
                                        for (j = 0; j < NUM_PYRO_VALUES; j++)
-                                               if (!strcmp (words[2], ao_pyro_values[j].name))
+                                               if (!strcmp (words[i], ao_pyro_values[j].name))
                                                        break;
                                        if (j == NUM_PYRO_VALUES)
                                                continue;
                                                        break;
                                        if (j == NUM_PYRO_VALUES)
                                                continue;