1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-17 21:35:44 +03:00

Merge pull request #5947 from dbasch/gps_rescue_rc1

Fix GPS Rescue (needs yaw smoothing but works).
This commit is contained in:
Michael Keller 2018-05-23 10:59:34 +12:00 committed by GitHub
commit a3b67d77b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 4 deletions

View file

@ -68,4 +68,5 @@ const char * const debugModeNames[DEBUG_COUNT] = {
"CURRENT_SENSOR",
"USB",
"SMARTAUDIO",
"RTH",
};

View file

@ -164,7 +164,6 @@ void updateGPSRescueState(void)
}
newGPSData = false;
}
void sensorUpdate()
@ -304,6 +303,7 @@ void rescueAttainPosition()
return;
}
/**
Speed controller
*/
@ -363,8 +363,8 @@ void setBearing(int16_t deg)
dif -= 360;
dif *= -GET_DIRECTION(rcControlsConfig()->yaw_control_reversed);
rcCommand[YAW] -= dif * gpsRescue()->yawP / 4;
dif = constrain(dif, -5, 5); // TODO: very basic smoothing, we need something less twitchy
rcCommand[YAW] -= dif * gpsRescue()->yawP / 20;
}
#endif

View file

@ -196,6 +196,7 @@ void initActiveBoxIds(void)
if (feature(FEATURE_GPS)) {
BME(BOXGPSHOME);
BME(BOXGPSHOLD);
BME(BOXGPSRESCUE);
BME(BOXBEEPGPSCOUNT);
}
#endif

View file

@ -243,7 +243,7 @@ PG_RESET_TEMPLATE(gpsRescue_t, gpsRescue,
.velP = 80,
.velI = 20,
.velD = 15,
.yawP = 15,
.yawP = 40,
.throttleMin = 1200,
.throttleMax = 1600,
.throttleHover = 1280,

View file

@ -548,6 +548,8 @@ static bool osdDrawSingleElement(uint8_t item)
strcpy(buff, "STAB");
} else if (FLIGHT_MODE(HORIZON_MODE)) {
strcpy(buff, "HOR ");
} else if (FLIGHT_MODE(GPS_RESCUE_MODE)) {
strcpy(buff, "RESC");
} else if (isAirmodeActive()) {
strcpy(buff, "AIR ");
} else {