projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos/lisp: Share binary search for memory chunk between mark and move
[fw/altos]
/
altoslib
/
AltosTelemetryMegaData.java
diff --git
a/altoslib/AltosTelemetryMegaData.java
b/altoslib/AltosTelemetryMegaData.java
index ffd825462a0b5691da2e1528977a513cfcaf674e..6ea5ec89897ab541bf1a2c7ca85328f806f65163 100644
(file)
--- a/
altoslib/AltosTelemetryMegaData.java
+++ b/
altoslib/AltosTelemetryMegaData.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_
3
;
+package org.altusmetrum.altoslib_
11
;
public class AltosTelemetryMegaData extends AltosTelemetryStandard {
int state;
public class AltosTelemetryMegaData extends AltosTelemetryStandard {
int state;
@@
-31,12
+32,12
@@
public class AltosTelemetryMegaData extends AltosTelemetryStandard {
int acceleration;
int speed;
int acceleration;
int speed;
- int height;
+ int height
_16
;
public AltosTelemetryMegaData(int[] bytes) {
super(bytes);
public AltosTelemetryMegaData(int[] bytes) {
super(bytes);
- state = int8(5);
+ state =
u
int8(5);
v_batt = int16(6);
v_pyro = int16(8);
v_batt = int16(6);
v_pyro = int16(8);
@@
-44,7
+45,7
@@
public class AltosTelemetryMegaData extends AltosTelemetryStandard {
sense = new int[6];
for (int i = 0; i < 6; i++) {
sense = new int[6];
for (int i = 0; i < 6; i++) {
- sense[i] = int8(10 + i) << 4;
+ sense[i] =
u
int8(10 + i) << 4;
sense[i] |= sense[i] >> 8;
}
sense[i] |= sense[i] >> 8;
}
@@
-55,7
+56,8
@@
public class AltosTelemetryMegaData extends AltosTelemetryStandard {
acceleration = int16(26);
speed = int16(28);
acceleration = int16(26);
speed = int16(28);
- height = int16(30);
+
+ height_16 = int16(30);
}
public void update_state(AltosState state) {
}
public void update_state(AltosState state) {
@@
-79,7
+81,13
@@
public class AltosTelemetryMegaData extends AltosTelemetryStandard {
state.set_ground_pressure(ground_pres);
state.set_accel_g(accel_plus_g, accel_minus_g);
state.set_ground_pressure(ground_pres);
state.set_accel_g(accel_plus_g, accel_minus_g);
- state.set_kalman(height, speed/16.0, acceleration / 16.0);
+ /* Fill in the high bits of height from recent GPS
+ * data if available, otherwise guess using the
+ * previous kalman height
+ */
+
+ state.set_kalman(extend_height(state, height_16),
+ speed/16.0, acceleration / 16.0);
}
}
}
}