Browse Source

AP_AHRS: add method to check if ext nav is used for yaw

mission-4.1.18
hoangthien94 6 years ago committed by Randy Mackay
parent
commit
916de076ec
  1. 12
      libraries/AP_AHRS/AP_AHRS_NavEKF.cpp
  2. 3
      libraries/AP_AHRS/AP_AHRS_NavEKF.h

12
libraries/AP_AHRS/AP_AHRS_NavEKF.cpp

@ -1821,5 +1821,17 @@ AP_AHRS_NavEKF &AP::ahrs_navekf() @@ -1821,5 +1821,17 @@ AP_AHRS_NavEKF &AP::ahrs_navekf()
return static_cast<AP_AHRS_NavEKF&>(*AP_AHRS::get_singleton());
}
// check whether compass can be bypassed for arming check in case when external navigation data is available
bool AP_AHRS_NavEKF::is_ext_nav_used_for_yaw(void) const
{
switch (active_EKF_type()) {
case EKF_TYPE2:
return EKF2.isExtNavUsedForYaw();
default:
return false;
}
}
#endif // AP_AHRS_NAVEKF_AVAILABLE

3
libraries/AP_AHRS/AP_AHRS_NavEKF.h

@ -264,6 +264,9 @@ public: @@ -264,6 +264,9 @@ public:
void Log_Write();
// check whether compass can be bypassed for arming check in case when external navigation data is available
bool is_ext_nav_used_for_yaw(void) const;
private:
enum EKF_TYPE {EKF_TYPE_NONE=0,
EKF_TYPE3=3,

Loading…
Cancel
Save