Browse Source

AP_NavEKF2: set rejecting_airspeed flag

we report as rejecting airspeed when we have not fused airspeed for 3s
and want to use airspeed
gps-1.3.1
Andrew Tridgell 3 years ago
parent
commit
949975a856
  1. 6
      libraries/AP_NavEKF2/AP_NavEKF2_AirDataFusion.cpp
  2. 4
      libraries/AP_NavEKF2/AP_NavEKF2_Control.cpp
  3. 1
      libraries/AP_NavEKF2/AP_NavEKF2_core.h

6
libraries/AP_NavEKF2/AP_NavEKF2_AirDataFusion.cpp

@ -113,6 +113,12 @@ void NavEKF2_core::FuseAirspeed() @@ -113,6 +113,12 @@ void NavEKF2_core::FuseAirspeed()
bool tasHealth = ((tasTestRatio < 1.0f) || badIMUdata);
tasTimeout = (imuSampleTime_ms - lastTasPassTime_ms) > frontend->tasRetryTime_ms;
if (!tasHealth) {
lastTasFailTime_ms = imuSampleTime_ms;
} else {
lastTasFailTime_ms = 0;
}
// test the ratio before fusing data, forcing fusion if airspeed and position are timed out as we have no choice but to try and use airspeed to constrain error growth
if (tasHealth || (tasTimeout && posTimeout)) {

4
libraries/AP_NavEKF2/AP_NavEKF2_Control.cpp

@ -519,6 +519,10 @@ void NavEKF2_core::updateFilterStatus(void) @@ -519,6 +519,10 @@ void NavEKF2_core::updateFilterStatus(void)
filterStatus.flags.using_gps = ((imuSampleTime_ms - lastPosPassTime_ms) < 4000) && (PV_AidingMode == AID_ABSOLUTE);
filterStatus.flags.gps_glitching = !gpsAccuracyGood && (PV_AidingMode == AID_ABSOLUTE) && !extNavUsedForPos; // GPS glitching is affecting navigation accuracy
filterStatus.flags.gps_quality_good = gpsGoodToAlign;
// for reporting purposes we report rejecting airspeed after 3s of not fusing when we want to fuse the data
filterStatus.flags.rejecting_airspeed = lastTasFailTime_ms != 0 &&
(imuSampleTime_ms - lastTasFailTime_ms) < 1000 &&
(imuSampleTime_ms - lastTasPassTime_ms) > 3000;
filterStatus.flags.initalized = filterStatus.flags.initalized || healthy();
}

1
libraries/AP_NavEKF2/AP_NavEKF2_core.h

@ -833,6 +833,7 @@ private: @@ -833,6 +833,7 @@ private:
uint32_t lastPosPassTime_ms; // time stamp when GPS position measurement last passed innovation consistency check (msec)
uint32_t lastHgtPassTime_ms; // time stamp when height measurement last passed innovation consistency check (msec)
uint32_t lastTasPassTime_ms; // time stamp when airspeed measurement last passed innovation consistency check (msec)
uint32_t lastTasFailTime_ms; // time stamp when airspeed measurement last failed innovation consistency check (msec)
uint32_t lastTimeGpsReceived_ms;// last time we received GPS data
uint32_t timeAtLastAuxEKF_ms; // last time the auxiliary filter was run to fuse range or optical flow measurements
uint32_t lastHealthyMagTime_ms; // time the magnetometer was last declared healthy

Loading…
Cancel
Save