mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-18 08:54:15 +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
|
* @addtogroup OpenPilot Libraries OpenPilot System Libraries
|
||||||
* @{
|
* @{
|
||||||
* @file sanitycheck.c
|
* @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
|
* @brief Utilities to validate a flight configuration
|
||||||
* @see The GNU Public License (GPL) Version 3
|
* @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
|
* sure it is appropriate for the airframe
|
||||||
* @param[in] index Which stabilization mode to check
|
* @param[in] index Which stabilization mode to check
|
||||||
* @returns true or false
|
* @returns true or false
|
||||||
@ -304,12 +305,11 @@ static bool check_stabilization_settings(int index, bool multirotor, bool copter
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if cruise control, ensure Acro+ is not set
|
||||||
// if cruise control, ensure rate or acro are not set
|
|
||||||
if (modes[FLIGHTMODESETTINGS_STABILIZATION1SETTINGS_THRUST] == FLIGHTMODESETTINGS_STABILIZATION1SETTINGS_CRUISECONTROL) {
|
if (modes[FLIGHTMODESETTINGS_STABILIZATION1SETTINGS_THRUST] == FLIGHTMODESETTINGS_STABILIZATION1SETTINGS_CRUISECONTROL) {
|
||||||
for (uint32_t i = 0; i < FLIGHTMODESETTINGS_STABILIZATION1SETTINGS_YAW; i++) {
|
for (uint32_t i = 0; i < FLIGHTMODESETTINGS_STABILIZATION1SETTINGS_YAW; i++) {
|
||||||
if ((modes[i] == FLIGHTMODESETTINGS_STABILIZATION1SETTINGS_RATE ||
|
// Do not allow Acro+, attitude estimation is not safe.
|
||||||
modes[i] == FLIGHTMODESETTINGS_STABILIZATION1SETTINGS_ACRO)) {
|
if (modes[i] == FLIGHTMODESETTINGS_STABILIZATION1SETTINGS_ACRO) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user