projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos/arm: Align data so that gcc 5.4 doesn't do byte-accesses. Add -Wcast-align
[fw/altos]
/
altoslib
/
AltosTelemetryLocation.java
diff --git
a/altoslib/AltosTelemetryLocation.java
b/altoslib/AltosTelemetryLocation.java
index 8368188f895492d42b83385babb524836e1a0b68..1199564020bbf57173443dad3e3d340a4d1712ba 100644
(file)
--- a/
altoslib/AltosTelemetryLocation.java
+++ b/
altoslib/AltosTelemetryLocation.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
*
* 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
*
* 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.
*/
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-package org.altusmetrum.altoslib_
4
;
+package org.altusmetrum.altoslib_
11
;
public class AltosTelemetryLocation extends AltosTelemetryStandard {
public class AltosTelemetryLocation extends AltosTelemetryStandard {
@@
-37,11
+38,12
@@
public class AltosTelemetryLocation extends AltosTelemetryStandard {
int climb_rate;
int course;
int climb_rate;
int course;
+ public static final int AO_GPS_MODE_ALTITUDE_24 = (1 << 0); /* Reports 24-bits of altitude */
+
public AltosTelemetryLocation(int[] bytes) {
super(bytes);
flags = uint8(5);
public AltosTelemetryLocation(int[] bytes) {
super(bytes);
flags = uint8(5);
- altitude = int16(6);
latitude = uint32(8);
longitude = uint32(12);
year = uint8(16);
latitude = uint32(8);
longitude = uint32(12);
year = uint8(16);
@@
-57,6
+59,11
@@
public class AltosTelemetryLocation extends AltosTelemetryStandard {
ground_speed = uint16(26);
climb_rate = int16(28);
course = uint8(30);
ground_speed = uint16(26);
climb_rate = int16(28);
course = uint8(30);
+
+ if ((mode & AO_GPS_MODE_ALTITUDE_24) != 0) {
+ altitude = (int8(31) << 16) | uint16(6);
+ } else
+ altitude = int16(6);
}
public void update_state(AltosState state) {
}
public void update_state(AltosState state) {
@@
-80,8
+87,9
@@
public class AltosTelemetryLocation extends AltosTelemetryStandard {
gps.ground_speed = ground_speed * 1.0e-2;
gps.course = course * 2;
gps.climb_rate = climb_rate * 1.0e-2;
gps.ground_speed = ground_speed * 1.0e-2;
gps.course = course * 2;
gps.climb_rate = climb_rate * 1.0e-2;
- gps.hdop = hdop;
- gps.vdop = vdop;
+ gps.pdop = pdop / 10.0;
+ gps.hdop = hdop / 10.0;
+ gps.vdop = vdop / 10.0;
}
state.set_temp_gps();
}
}
state.set_temp_gps();
}