Switch from GPLv2 to GPLv2+
[fw/altos] / altoslib / AltosTelemetryMegaSensor.java
index 1b568c88cea80b47ca45bc6edc5d63559b32514d..2dfc455aa5ca0d09adf7859d1581e6344ddfc405 100644 (file)
@@ -3,7 +3,8 @@
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -15,7 +16,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib_5;
+package org.altusmetrum.altoslib_11;
 
 public class AltosTelemetryMegaSensor extends AltosTelemetryStandard {
        int     accel;
@@ -66,24 +67,13 @@ public class AltosTelemetryMegaSensor extends AltosTelemetryStandard {
 
                state.set_orient(orient);
 
-               AltosIMU imu = new AltosIMU();
+               state.set_imu(new AltosIMU(accel_y,     /* along */
+                                          accel_x,     /* across */
+                                          accel_z,     /* through */
+                                          gyro_y,      /* along */
+                                          gyro_x,      /* across */
+                                          gyro_z));    /* through */
 
-               imu.accel_x = AltosIMU.convert_accel(accel_x);
-               imu.accel_y = AltosIMU.convert_accel(accel_y);
-               imu.accel_z = AltosIMU.convert_accel(accel_z);
-
-               imu.gyro_x = AltosIMU.convert_gyro(gyro_x);
-               imu.gyro_y = AltosIMU.convert_gyro(gyro_y);
-               imu.gyro_z = AltosIMU.convert_gyro(gyro_z);
-
-               state.imu = imu;
-
-               AltosMag mag = new AltosMag();
-
-               mag.x = AltosMag.convert_gauss(mag_x);
-               mag.y = AltosMag.convert_gauss(mag_y);
-               mag.z = AltosMag.convert_gauss(mag_z);
-
-               state.mag = mag;
+               state.set_mag(new AltosMag(mag_x, mag_y, mag_z));
        }
 }