Browse Source

Copter: ignore first ekf core switch

The ekf core is initialised to -1 but after initialisation changes to zero.  Ignore this first change.
master
Randy Mackay 8 years ago
parent
commit
26c3295042
  1. 2
      ArduCopter/Copter.h
  2. 4
      ArduCopter/ekf_check.cpp

2
ArduCopter/Copter.h

@ -223,7 +223,7 @@ private: @@ -223,7 +223,7 @@ private:
// system time in milliseconds of last recorded yaw reset from ekf
uint32_t ekfYawReset_ms = 0;
uint8_t ekf_primary_core;
int8_t ekf_primary_core;
// GCS selection
AP_SerialManager serial_manager;

4
ArduCopter/ekf_check.cpp

@ -183,10 +183,10 @@ void Copter::check_ekf_reset() @@ -183,10 +183,10 @@ void Copter::check_ekf_reset()
#if AP_AHRS_NAVEKF_AVAILABLE
// check for change in primary EKF (log only, AC_WPNav handles position target adjustment)
if (EKF2.getPrimaryCoreIndex() != ekf_primary_core) {
if ((EKF2.getPrimaryCoreIndex() != ekf_primary_core) && (EKF2.getPrimaryCoreIndex() != -1)) {
ekf_primary_core = EKF2.getPrimaryCoreIndex();
Log_Write_Error(ERROR_SUBSYSTEM_EKF_PRIMARY, ekf_primary_core);
gcs_send_text_fmt(MAV_SEVERITY_WARNING, "EKF primary changed:%u\n", (unsigned)ekf_primary_core);
gcs_send_text_fmt(MAV_SEVERITY_WARNING, "EKF primary changed:%d\n", (unsigned)ekf_primary_core);
}
#endif
}

Loading…
Cancel
Save