AP_AHRS : add method to report if EKF is waiting to start

This commit is contained in:
priseborough 2014-09-29 18:37:14 +10:00 committed by Randy Mackay
parent 89755c2bb5
commit b51d01f979
5 changed files with 19 additions and 0 deletions

View File

@ -338,6 +338,9 @@ public:
// is the AHRS subsystem healthy? // is the AHRS subsystem healthy?
virtual bool healthy(void) = 0; virtual bool healthy(void) = 0;
// is the EKF waiting to start?
virtual bool ekfNotStarted(void) = 0;
protected: protected:
AHRS_VehicleClass _vehicle_class; AHRS_VehicleClass _vehicle_class;

View File

@ -937,3 +937,8 @@ bool AP_AHRS_DCM::healthy(void)
// consider ourselves healthy if there have been no failures for 5 seconds // consider ourselves healthy if there have been no failures for 5 seconds
return (_last_failure_ms == 0 || hal.scheduler->millis() - _last_failure_ms > 5000); return (_last_failure_ms == 0 || hal.scheduler->millis() - _last_failure_ms > 5000);
} }
bool AP_AHRS_DCM::ekfNotStarted(void)
{
return false;
}

View File

@ -106,6 +106,9 @@ public:
// is the AHRS subsystem healthy? // is the AHRS subsystem healthy?
bool healthy(void); bool healthy(void);
// is the EKF waiting to start?
bool ekfNotStarted(void);
private: private:
float _ki; float _ki;
float _ki_yaw; float _ki_yaw;

View File

@ -266,5 +266,10 @@ bool AP_AHRS_NavEKF::healthy(void)
return AP_AHRS_DCM::healthy(); return AP_AHRS_DCM::healthy();
} }
bool AP_AHRS_NavEKF::ekfNotStarted(void)
{
return !ekf_started;
}
#endif // AP_AHRS_NAVEKF_AVAILABLE #endif // AP_AHRS_NAVEKF_AVAILABLE

View File

@ -95,6 +95,9 @@ public:
// is the AHRS subsystem healthy? // is the AHRS subsystem healthy?
bool healthy(void); bool healthy(void);
// is the EKF waiting to start?
bool ekfNotStarted(void);
private: private:
bool using_EKF(void) const; bool using_EKF(void) const;