- public int accel_x = AltosLib.MISSING;
- public int accel_y = AltosLib.MISSING;
- public int accel_z = AltosLib.MISSING;
-
- public int gyro_x = AltosLib.MISSING;
- public int gyro_y = AltosLib.MISSING;
- public int gyro_z = AltosLib.MISSING;
-
- public int mag_x = AltosLib.MISSING;
- public int mag_y = AltosLib.MISSING;
- public int mag_z = AltosLib.MISSING;
-
- public static final double counts_per_g_mpu = 2048.0;
- public static final double counts_per_g_bmx = 2048.0;
+ private int accel_x = AltosLib.MISSING;
+ private int accel_y = AltosLib.MISSING;
+ private int accel_z = AltosLib.MISSING;
+
+ private int accel_along = AltosLib.MISSING;
+ private int accel_across = AltosLib.MISSING;
+ private int accel_through = AltosLib.MISSING;
+
+ private int gyro_x = AltosLib.MISSING;
+ private int gyro_y = AltosLib.MISSING;
+ private int gyro_z = AltosLib.MISSING;
+
+ private int gyro_roll = AltosLib.MISSING;
+ private int gyro_pitch = AltosLib.MISSING;
+ private int gyro_yaw = AltosLib.MISSING;
+
+ private int mag_x = AltosLib.MISSING;
+ private int mag_y = AltosLib.MISSING;
+ private int mag_z = AltosLib.MISSING;
+
+ private int mag_along = AltosLib.MISSING;
+ private int mag_across = AltosLib.MISSING;
+ private int mag_through = AltosLib.MISSING;
+
+ private int imu_model = AltosLib.MISSING;
+ private int mag_model = AltosLib.MISSING;
+
+ private static final double counts_per_g_mpu = 2048.0;
+ private static final double counts_per_g_bmx = 2048.0;
+ private static final double counts_per_g_adxl = 20.5;
+ private static final double counts_per_g_bmi088 = 1365.0;
+
+ private static double counts_per_g(int imu_type, int imu_model) {
+ switch (imu_model) {
+ case AltosLib.model_mpu6000:
+ case AltosLib.model_mpu9250:
+ return counts_per_g_mpu;
+ case AltosLib.model_adxl375:
+ return counts_per_g_adxl;
+ case AltosLib.model_bmx160:
+ return counts_per_g_bmx;
+ case AltosLib.model_bmi088:
+ return counts_per_g_bmi088;
+ }