X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altoslib%2FAltosIMU.java;h=e63eeaf9e0844c4e56d0f3edccad12b02d5662e3;hp=98998956bf75ad6544bd51792690456bdc060d40;hb=cec4dea23b7b3cfe0f0a43c19b3118cc98cb9414;hpb=a5a8a4d8de49484a2edba62cc9b84377aa5415a6 diff --git a/altoslib/AltosIMU.java b/altoslib/AltosIMU.java index 98998956..e63eeaf9 100644 --- a/altoslib/AltosIMU.java +++ b/altoslib/AltosIMU.java @@ -88,11 +88,7 @@ public class AltosIMU implements Cloneable { public static final double MAG_COUNTS_MPU = 32767.0; public static final double counts_per_gauss_mpu = MAG_COUNTS_MPU / MAG_FULLSCALE_GAUSS_MPU; - public static final double MAG_FULLSCALE_GAUSS_BMX_XY = 11.50; /* 1150µT */ - public static final double MAG_FULLSCALE_GAUSS_BMX_Z = 25.00; /* 2500µT */ - public static final double MAG_COUNTS_BMX = 32767.0; - public static final double counts_per_gauss_bmx_xy = MAG_COUNTS_BMX / MAG_FULLSCALE_GAUSS_BMX_XY; - public static final double counts_per_gauss_bmx_z = MAG_COUNTS_BMX / MAG_FULLSCALE_GAUSS_BMX_Z; + public static final double counts_per_gauss_bmx = 100.0; /* BMX driver converts to µT */ public static double counts_per_gauss(int imu_type, int axis) { switch(imu_type) { @@ -103,14 +99,7 @@ public class AltosIMU implements Cloneable { case imu_type_easymega_v2: return counts_per_gauss_mpu; case imu_type_telemega_v4: - switch (axis) { - case imu_axis_x: - case imu_axis_y: - return counts_per_gauss_bmx_xy; - case imu_axis_z: - return counts_per_gauss_bmx_z; - } - /* fall through */ + return 100.0; default: return AltosLib.MISSING; } @@ -126,8 +115,6 @@ public class AltosIMU implements Cloneable { String[] items = line.split("\\s+"); - System.out.printf("length %d\n", items.length); - if (items.length >= 8) { accel_x = Integer.parseInt(items[1]); accel_y = Integer.parseInt(items[2]); @@ -225,7 +212,7 @@ public class AltosIMU implements Cloneable { case imu_type_easymega_v2: return -gyro_y; case imu_type_telemega_v4: - return gyro_y; + return -gyro_y; default: return AltosLib.MISSING; } @@ -255,9 +242,10 @@ public class AltosIMU implements Cloneable { case imu_type_telemega_v3: case imu_type_easymega_v1: return mag_x; - case imu_type_telemega_v4: case imu_type_easymega_v2: return -mag_y; + case imu_type_telemega_v4: + return mag_y; default: return AltosLib.MISSING; }