Fixed RaceFlight rates calculation.

This commit is contained in:
Michael Keller 2018-01-29 14:14:35 +13:00 committed by mikeller
parent e5e6fcb60a
commit 52f29f6e81
1 changed files with 1 additions and 3 deletions

View File

@ -108,13 +108,11 @@ float applyBetaflightRates(const int axis, float rcCommandf, const float rcComma
float applyRaceFlightRates(const int axis, float rcCommandf, const float rcCommandfAbs)
{
UNUSED(rcCommandfAbs);
// -1.0 to 1.0 ranged and curved
rcCommandf = ((1.0f + 0.01f * currentControlRateProfile->rcExpo[axis] * (rcCommandf * rcCommandf - 1.0f)) * rcCommandf);
// convert to -2000 to 2000 range using acro+ modifier
float angleRate = 10.0f * currentControlRateProfile->rcRates[axis] * rcCommandf;
angleRate = angleRate * (1 + (float)currentControlRateProfile->rates[axis] * 0.01f);
angleRate = angleRate * (1 + rcCommandfAbs * (float)currentControlRateProfile->rates[axis] * 0.01f);
return angleRate;
}