* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altoslib_2;
+package org.altusmetrum.altoslib_9;
public class AltosTelemetryMegaSensor extends AltosTelemetryStandard {
int accel;
int mag_y;
int mag_z;
+ int orient;
+
public AltosTelemetryMegaSensor(int[] bytes) {
super(bytes);
+ orient = int8(5);
accel = int16(6);
pres = int32(8);
temp = int16(12);
state.set_pressure(pres);
state.set_temperature(temp / 100.0);
- AltosIMU imu = new AltosIMU();
-
- imu.accel_x = accel_x;
- imu.accel_y = accel_y;
- imu.accel_z = accel_z;
-
- imu.gyro_x = gyro_x;
- imu.gyro_y = gyro_y;
- imu.gyro_z = gyro_z;
-
- state.imu = imu;
-
- AltosMag mag = new AltosMag();
+ state.set_orient(orient);
- mag.x = mag_x;
- mag.y = mag_y;
- mag.z = mag_z;
+ state.set_imu(new AltosIMU(accel_y, /* along */
+ accel_x, /* across */
+ accel_z, /* through */
+ gyro_y, /* along */
+ gyro_x, /* across */
+ gyro_z)); /* through */
- state.mag = mag;
+ state.set_mag(new AltosMag(mag_x, mag_y, mag_z));
}
}