This makes sure we report the true apogee value instead of looking for
the maximum height value in the flight data, in case the flight
recording ended before the apogee was reached.
Signed-off-by: Keith Packard <keithp@keithp.com>
return altitude(i) - ground_altitude;
}
return altitude(i) - ground_altitude;
}
+ public double apogee_pressure() {
+ return min_pressure;
+ }
+
+ public double apogee_altitude() {
+ return AltosConvert.pressure_to_altitude(apogee_pressure());
+ }
+
+ public double apogee_height() {
+ return apogee_altitude() - ground_altitude;
+ }
+
static final int speed_avg = 3;
static final int accel_avg = 5;
static final int speed_avg = 3;
static final int accel_avg = 5;
+ apogee_height = data.apogee_height();
+ double searched_apogee = 0;
+ /* This just finds the apogee time -- we've recorded the
+ * peak altitude separately in eeprom, and that could
+ * have occurred after the eeprom was full.
+ */
for (MicroDataPoint point : data.points()) {
for (MicroDataPoint point : data.points()) {
- if (point.height > apogee_height) {
- apogee_height = point.height;
+ if (point.height > searched_apogee) {
+ searched_apogee = point.height;
apogee_time = point.time;
}
}
apogee_time = point.time;
}
}