1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-10 18:24:11 +01:00

LP_620 Always recognize VelocityRoam as "assisted"

This commit is contained in:
julian_lilov 2021-01-07 17:10:34 +02:00
parent 6915a2c188
commit 3c2cc704a5

View File

@ -914,6 +914,23 @@ static void applyLPF(float *value, ManualControlSettingsResponseTimeElem channel
#ifndef PIOS_EXCLUDE_ADVANCED_FEATURES #ifndef PIOS_EXCLUDE_ADVANCED_FEATURES
static uint8_t isAssistedFlightMode(uint8_t position) static uint8_t isAssistedFlightMode(uint8_t position)
{ {
// Since VelocityRoam is by all means an "assisted" mode,
// here we do explicitly recognize it as "assisted", no matter
// if it has "GPSAssist" set in FlightModeAssistMap or not, thus
// always applying the "Assisted Control stick deadband" when
// VelocityRoam is active.
FlightModeSettingsData modeSettings;
FlightModeSettingsGet(&modeSettings);
uint8_t thisMode = FLIGHTSTATUS_FLIGHTMODE_MANUAL;
if (position < FLIGHTMODESETTINGS_FLIGHTMODEPOSITION_NUMELEM) {
thisMode = modeSettings.FlightModePosition[position];
}
if (thisMode == FLIGHTSTATUS_FLIGHTMODE_VELOCITYROAM) {
return STABILIZATIONSETTINGS_FLIGHTMODEASSISTMAP_GPSASSIST;
}
uint8_t isAssistedFlag = STABILIZATIONSETTINGS_FLIGHTMODEASSISTMAP_NONE; uint8_t isAssistedFlag = STABILIZATIONSETTINGS_FLIGHTMODEASSISTMAP_NONE;
uint8_t FlightModeAssistMap[STABILIZATIONSETTINGS_FLIGHTMODEASSISTMAP_NUMELEM]; uint8_t FlightModeAssistMap[STABILIZATIONSETTINGS_FLIGHTMODEASSISTMAP_NUMELEM];