mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-29 07:24:13 +01:00
LP-241 Allow CruiseControl + Rate stabilization
This commit is contained in:
parent
b1cc1332ec
commit
7ce2d7562e
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user