|
|
|
@ -343,9 +343,11 @@ bool NavEKF2_core::readDeltaVelocity(uint8_t ins_index, Vector3f &dVel, float &d
@@ -343,9 +343,11 @@ bool NavEKF2_core::readDeltaVelocity(uint8_t ins_index, Vector3f &dVel, float &d
|
|
|
|
|
void NavEKF2_core::readGpsData() |
|
|
|
|
{ |
|
|
|
|
// check for new GPS data
|
|
|
|
|
if ((_ahrs->get_gps().last_message_time_ms() != lastTimeGpsReceived_ms) && |
|
|
|
|
(_ahrs->get_gps().status() >= AP_GPS::GPS_OK_FIX_3D)) |
|
|
|
|
{ |
|
|
|
|
if (_ahrs->get_gps().last_message_time_ms() != lastTimeGpsReceived_ms) { |
|
|
|
|
if (_ahrs->get_gps().status() >= AP_GPS::GPS_OK_FIX_3D) { |
|
|
|
|
// report GPS fix status
|
|
|
|
|
gpsCheckStatus.bad_fix = false; |
|
|
|
|
|
|
|
|
|
// store fix time from previous read
|
|
|
|
|
secondLastGpsTime_ms = lastTimeGpsReceived_ms; |
|
|
|
|
|
|
|
|
@ -426,6 +428,10 @@ void NavEKF2_core::readGpsData()
@@ -426,6 +428,10 @@ void NavEKF2_core::readGpsData()
|
|
|
|
|
|
|
|
|
|
// declare GPS available for use
|
|
|
|
|
gpsNotAvailable = false; |
|
|
|
|
} else { |
|
|
|
|
// report GPS fix status
|
|
|
|
|
gpsCheckStatus.bad_fix = true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// We need to handle the case where GPS is lost for a period of time that is too long to dead-reckon
|
|
|
|
|