From 4408f01f39349a3cc93ad5c27f200fd70b96a63a Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Wed, 10 Jun 2015 10:16:52 +0900 Subject: [PATCH] Copter: rename ekf_check_thresh to fs_ekf_thresh --- ArduCopter/Parameters.cpp | 10 +++++----- ArduCopter/Parameters.h | 4 ++-- ArduCopter/config.h | 6 +++--- ArduCopter/ekf_check.cpp | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ArduCopter/Parameters.cpp b/ArduCopter/Parameters.cpp index 292e47d6d0..8708a38d6f 100644 --- a/ArduCopter/Parameters.cpp +++ b/ArduCopter/Parameters.cpp @@ -479,12 +479,12 @@ const AP_Param::Info Copter::var_info[] PROGMEM = { // @User: Advanced GSCALAR(land_repositioning, "LAND_REPOSITION", LAND_REPOSITION_DEFAULT), - // @Param: EKF_CHECK_THRESH - // @DisplayName: EKF check compass and velocity variance threshold - // @Description: Allows setting the maximum acceptable compass and velocity variance (0 to disable check) - // @Values: 0:Disabled, 0.6:Strict, 0.8:Default, 1.0:Relaxed + // @Param: FS_EKF_THRESH + // @DisplayName: EKF failsafe variance threshold + // @Description: Allows setting the maximum acceptable compass and velocity variance + // @Values: 0.6:Strict, 0.8:Default, 1.0:Relaxed // @User: Advanced - GSCALAR(ekfcheck_thresh, "EKF_CHECK_THRESH", EKFCHECK_THRESHOLD_DEFAULT), + GSCALAR(fs_ekf_thresh, "FS_EKF_THRESH", FS_EKF_THRESHOLD_DEFAULT), #if FRAME_CONFIG == HELI_FRAME // @Group: HS1_ diff --git a/ArduCopter/Parameters.h b/ArduCopter/Parameters.h index 9d33aa272b..6eefa9b000 100644 --- a/ArduCopter/Parameters.h +++ b/ArduCopter/Parameters.h @@ -120,7 +120,7 @@ public: k_param_serial2_baud, // deprecated - remove k_param_land_repositioning, k_param_sonar, // sonar object - k_param_ekfcheck_thresh, + k_param_fs_ekf_thresh, k_param_terrain, k_param_acro_expo, k_param_throttle_deadzone, @@ -414,7 +414,7 @@ public: AP_Int8 arming_check; AP_Int8 land_repositioning; - AP_Float ekfcheck_thresh; + AP_Float fs_ekf_thresh; AP_Int16 gcs_pid_mask; #if FRAME_CONFIG == HELI_FRAME diff --git a/ArduCopter/config.h b/ArduCopter/config.h index 526d5b2ed0..e48d6de168 100644 --- a/ArduCopter/config.h +++ b/ArduCopter/config.h @@ -269,9 +269,9 @@ #endif ////////////////////////////////////////////////////////////////////////////// -// EKF Checker -#ifndef EKFCHECK_THRESHOLD_DEFAULT - # define EKFCHECK_THRESHOLD_DEFAULT 0.8f // EKF checker's default compass and velocity variance above which the EKF's horizontal position will be considered bad +// EKF Failsafe +#ifndef FS_EKF_THRESHOLD_DEFAULT + # define FS_EKF_THRESHOLD_DEFAULT 0.8f // EKF failsafe's default compass and velocity variance threshold above which the EKF failsafe will be triggered #endif #ifndef EKF_ORIGIN_MAX_DIST_M diff --git a/ArduCopter/ekf_check.cpp b/ArduCopter/ekf_check.cpp index ad191fd44c..ea98857b80 100644 --- a/ArduCopter/ekf_check.cpp +++ b/ArduCopter/ekf_check.cpp @@ -31,7 +31,7 @@ static struct { void Copter::ekf_check() { // return immediately if motors are not armed, ekf check is disabled, not using ekf or usb is connected - if (!motors.armed() || ap.usb_connected || (g.ekfcheck_thresh <= 0.0f)) { + if (!motors.armed() || ap.usb_connected || (g.fs_ekf_thresh <= 0.0f)) { ekf_check_state.fail_count = 0; ekf_check_state.bad_variance = false; AP_Notify::flags.ekf_bad = ekf_check_state.bad_variance; @@ -87,7 +87,7 @@ bool Copter::ekf_over_threshold() { #if AP_AHRS_NAVEKF_AVAILABLE // return false immediately if disabled - if (g.ekfcheck_thresh <= 0.0f) { + if (g.fs_ekf_thresh <= 0.0f) { return false; } @@ -106,7 +106,7 @@ bool Copter::ekf_over_threshold() compass_variance = magVar.length(); // return true if compass and velocity variance over the threshold - return (compass_variance >= g.ekfcheck_thresh && vel_variance >= g.ekfcheck_thresh); + return (compass_variance >= g.fs_ekf_thresh && vel_variance >= g.fs_ekf_thresh); #else return false; #endif