1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-15 20:35:33 +03:00

Fix GPS Rescue (needs yaw smoothing but works).

This commit is contained in:
Diego Basch 2018-05-21 11:35:40 -07:00
parent 041362614b
commit c3412225f5
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 {