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

Merged in LP-620_VelocityRoam_HoldPosition_Drift_Fix (pull request #542)

LP_620 Fix issue with VelocityRoam not holding position in wind (Pitch/Roll sticks centered)

Approved-by: Eric Price
This commit is contained in:
Julian Lilov 2022-06-14 20:13:57 +00:00 committed by Eric Price
commit a8f9574e56

View File

@ -914,6 +914,23 @@ static void applyLPF(float *value, ManualControlSettingsResponseTimeElem channel
#ifndef PIOS_EXCLUDE_ADVANCED_FEATURES
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 FlightModeAssistMap[STABILIZATIONSETTINGS_FLIGHTMODEASSISTMAP_NUMELEM];