If GPS becomes unlocked, then report that in the UI and via
voice.
Signed-off-by: Keith Packard <keithp@keithp.com>
double pad_lat;
double pad_lon;
double pad_alt;
double pad_lat;
double pad_lon;
double pad_alt;
+
+ static final int MIN_PAD_SAMPLES = 10;
+
+ int gps_waiting;
+ boolean gps_ready;
AltosGreatCircle from_pad;
AltosGreatCircle from_pad;
pad_lon = data.gps.lon;
pad_alt = data.gps.alt;
}
pad_lon = data.gps.lon;
pad_alt = data.gps.alt;
}
+
+ gps_waiting = MIN_PAD_SAMPLES - npad;
+ if (gps_waiting < 0)
+ gps_waiting = 0;
+
+ gps_ready = gps_waiting == 0;
+
ascent = (AltosTelemetry.ao_flight_boost <= state &&
state <= AltosTelemetry.ao_flight_coast);
ascent = (AltosTelemetry.ao_flight_boost <= state &&
state <= AltosTelemetry.ao_flight_coast);
flightInfoModel[i].finish();
}
flightInfoModel[i].finish();
}
- static final int MIN_PAD_SAMPLES = 10;
-
public void show(AltosState state) {
flightStatusModel.set(state);
info_reset();
public void show(AltosState state) {
flightStatusModel.set(state);
info_reset();
- if (state.npad >= MIN_PAD_SAMPLES)
info_add_row(0, "Ground state", "%s", "ready");
else
info_add_row(0, "Ground state", "wait (%d)",
info_add_row(0, "Ground state", "%s", "ready");
else
info_add_row(0, "Ground state", "wait (%d)",
- MIN_PAD_SAMPLES - state.npad);
info_add_row(0, "Rocket state", "%s", state.data.state);
info_add_row(0, "Callsign", "%s", state.data.callsign);
info_add_row(0, "Rocket serial", "%6d", state.data.serial);
info_add_row(0, "Rocket state", "%s", state.data.state);
info_add_row(0, "Callsign", "%s", state.data.callsign);
info_add_row(0, "Rocket serial", "%6d", state.data.serial);
(int) (state.max_height + 0.5));
}
}
(int) (state.max_height + 0.5));
}
}
+ if (old_state == null || old_state.gps_ready != state.gps_ready) {
+ if (state.gps_ready)
+ voice.speak("GPS ready");
+ else if (old_state != null)
+ voice.speak("GPS lost");
+ }