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:
parent
041362614b
commit
c3412225f5
5 changed files with 8 additions and 4 deletions
|
@ -68,4 +68,5 @@ const char * const debugModeNames[DEBUG_COUNT] = {
|
|||
"CURRENT_SENSOR",
|
||||
"USB",
|
||||
"SMARTAUDIO",
|
||||
"RTH",
|
||||
};
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -196,6 +196,7 @@ void initActiveBoxIds(void)
|
|||
if (feature(FEATURE_GPS)) {
|
||||
BME(BOXGPSHOME);
|
||||
BME(BOXGPSHOLD);
|
||||
BME(BOXGPSRESCUE);
|
||||
BME(BOXBEEPGPSCOUNT);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue