From 7ce2d7562efe8e534745fb5afd3d1a4a4ea082a3 Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Sat, 4 Jun 2016 21:02:36 +0200 Subject: [PATCH] LP-241 Allow CruiseControl + Rate stabilization --- flight/libraries/sanitycheck.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flight/libraries/sanitycheck.c b/flight/libraries/sanitycheck.c index bfb4b792b..a7cd0c5bf 100644 --- a/flight/libraries/sanitycheck.c +++ b/flight/libraries/sanitycheck.c @@ -5,7 +5,8 @@ * @addtogroup OpenPilot Libraries OpenPilot System Libraries * @{ * @file sanitycheck.c - * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. + * @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2016. + * The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. * @brief Utilities to validate a flight configuration * @see The GNU Public License (GPL) Version 3 * @@ -225,7 +226,7 @@ int32_t configuration_check() } /** - * Checks the stabiliation settings for a paritcular mode and makes + * Checks the stabilization settings for a particular mode and makes * sure it is appropriate for the airframe * @param[in] index Which stabilization mode to check * @returns true or false @@ -304,12 +305,11 @@ static bool check_stabilization_settings(int index, bool multirotor, bool copter return false; } - - // if cruise control, ensure rate or acro are not set + // if cruise control, ensure Acro+ is not set if (modes[FLIGHTMODESETTINGS_STABILIZATION1SETTINGS_THRUST] == FLIGHTMODESETTINGS_STABILIZATION1SETTINGS_CRUISECONTROL) { for (uint32_t i = 0; i < FLIGHTMODESETTINGS_STABILIZATION1SETTINGS_YAW; i++) { - if ((modes[i] == FLIGHTMODESETTINGS_STABILIZATION1SETTINGS_RATE || - modes[i] == FLIGHTMODESETTINGS_STABILIZATION1SETTINGS_ACRO)) { + // Do not allow Acro+, attitude estimation is not safe. + if (modes[i] == FLIGHTMODESETTINGS_STABILIZATION1SETTINGS_ACRO) { return false; } }