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",
|
"CURRENT_SENSOR",
|
||||||
"USB",
|
"USB",
|
||||||
"SMARTAUDIO",
|
"SMARTAUDIO",
|
||||||
|
"RTH",
|
||||||
};
|
};
|
||||||
|
|
|
@ -164,7 +164,6 @@ void updateGPSRescueState(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
newGPSData = false;
|
newGPSData = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void sensorUpdate()
|
void sensorUpdate()
|
||||||
|
@ -304,6 +303,7 @@ void rescueAttainPosition()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Speed controller
|
Speed controller
|
||||||
*/
|
*/
|
||||||
|
@ -363,8 +363,8 @@ void setBearing(int16_t deg)
|
||||||
dif -= 360;
|
dif -= 360;
|
||||||
|
|
||||||
dif *= -GET_DIRECTION(rcControlsConfig()->yaw_control_reversed);
|
dif *= -GET_DIRECTION(rcControlsConfig()->yaw_control_reversed);
|
||||||
|
dif = constrain(dif, -5, 5); // TODO: very basic smoothing, we need something less twitchy
|
||||||
rcCommand[YAW] -= dif * gpsRescue()->yawP / 4;
|
rcCommand[YAW] -= dif * gpsRescue()->yawP / 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -196,6 +196,7 @@ void initActiveBoxIds(void)
|
||||||
if (feature(FEATURE_GPS)) {
|
if (feature(FEATURE_GPS)) {
|
||||||
BME(BOXGPSHOME);
|
BME(BOXGPSHOME);
|
||||||
BME(BOXGPSHOLD);
|
BME(BOXGPSHOLD);
|
||||||
|
BME(BOXGPSRESCUE);
|
||||||
BME(BOXBEEPGPSCOUNT);
|
BME(BOXBEEPGPSCOUNT);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -243,7 +243,7 @@ PG_RESET_TEMPLATE(gpsRescue_t, gpsRescue,
|
||||||
.velP = 80,
|
.velP = 80,
|
||||||
.velI = 20,
|
.velI = 20,
|
||||||
.velD = 15,
|
.velD = 15,
|
||||||
.yawP = 15,
|
.yawP = 40,
|
||||||
.throttleMin = 1200,
|
.throttleMin = 1200,
|
||||||
.throttleMax = 1600,
|
.throttleMax = 1600,
|
||||||
.throttleHover = 1280,
|
.throttleHover = 1280,
|
||||||
|
|
|
@ -548,6 +548,8 @@ static bool osdDrawSingleElement(uint8_t item)
|
||||||
strcpy(buff, "STAB");
|
strcpy(buff, "STAB");
|
||||||
} else if (FLIGHT_MODE(HORIZON_MODE)) {
|
} else if (FLIGHT_MODE(HORIZON_MODE)) {
|
||||||
strcpy(buff, "HOR ");
|
strcpy(buff, "HOR ");
|
||||||
|
} else if (FLIGHT_MODE(GPS_RESCUE_MODE)) {
|
||||||
|
strcpy(buff, "RESC");
|
||||||
} else if (isAirmodeActive()) {
|
} else if (isAirmodeActive()) {
|
||||||
strcpy(buff, "AIR ");
|
strcpy(buff, "AIR ");
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue