Add more GPS checks for LPE (#4750)

* Added more GPS checks for LPE.

* Add logic to force GPS alt init.
This commit is contained in:
James Goppert
2016-06-06 19:40:41 -05:00
parent c64b0d4573
commit 97e6a57501
5 changed files with 24 additions and 3 deletions
@@ -51,8 +51,15 @@ int BlockLocalPositionEstimator::gpsMeasure(Vector<double, n_y_gps> &y)
// check for good gps signal
uint8_t nSat = _sub_gps.get().satellites_used;
float eph = _sub_gps.get().eph;
float epv = _sub_gps.get().epv;
uint8_t fix_type = _sub_gps.get().fix_type;
if (nSat < 6 || eph > _gps_eph_max.get()) {
if (
nSat < 6 ||
eph > _gps_eph_max.get() ||
epv > _gps_epv_max.get() ||
fix_type < 3
) {
return -1;
}