X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=altoslib%2FAltosTelemetryMegaSensor.java;h=2dfc455aa5ca0d09adf7859d1581e6344ddfc405;hp=d9fd7fdeadc0a25a09cdc5a02a21e54c1d93e9b7;hb=1085ec5d57e0ed5d132f2bbdac1a0b6a32c0ab4a;hpb=9e18c524fa2d1f648f265b3c3105f5ceacf06c10 diff --git a/altoslib/AltosTelemetryMegaSensor.java b/altoslib/AltosTelemetryMegaSensor.java index d9fd7fde..2dfc455a 100644 --- a/altoslib/AltosTelemetryMegaSensor.java +++ b/altoslib/AltosTelemetryMegaSensor.java @@ -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_3; +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)); } }