From 514568afcf648138319f7e24f14d856dfadd0a2e Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Mon, 18 Nov 2013 23:59:26 +0900 Subject: [PATCH] Copter: arming check for gps if GPS FS set to LAND_EVEN_STABILIZE Setting the GPS Failsafe to LAND_EVEN_STABILIZE means the copter will LAND if it loses GPS even if it's in a manual flight mode like Stabilize. With this setting it makes sense to check the GPS quality before arming even if we're in stabilize mode. --- ArduCopter/motors.pde | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ArduCopter/motors.pde b/ArduCopter/motors.pde index 636f75e673..1ebc68e6bb 100644 --- a/ArduCopter/motors.pde +++ b/ArduCopter/motors.pde @@ -289,7 +289,7 @@ static void pre_arm_checks(bool display_failure) // check GPS if ((g.arming_check_enabled == ARMING_CHECK_ALL) || (g.arming_check_enabled & ARMING_CHECK_GPS)) { // check gps is ok if required - note this same check is repeated again in arm_checks - if (mode_requires_GPS(control_mode) && !pre_arm_gps_checks()) { + if ((mode_requires_GPS(control_mode) || g.failsafe_gps_enabled == FS_GPS_LAND_EVEN_STABILIZE) && !pre_arm_gps_checks()) { if (display_failure) { gcs_send_text_P(SEVERITY_HIGH,PSTR("PreArm: Bad GPS Pos")); } @@ -439,7 +439,7 @@ static bool arm_checks(bool display_failure) // check gps is ok if required - note this same check is also done in pre-arm checks if ((g.arming_check_enabled == ARMING_CHECK_ALL) || (g.arming_check_enabled & ARMING_CHECK_GPS)) { - if (mode_requires_GPS(control_mode) && !pre_arm_gps_checks()) { + if ((mode_requires_GPS(control_mode) || g.failsafe_gps_enabled == FS_GPS_LAND_EVEN_STABILIZE) && !pre_arm_gps_checks()) { if (display_failure) { gcs_send_text_P(SEVERITY_HIGH,PSTR("Arm: Bad GPS Pos")); }