Plane: fixed stick mixing in AUTO modes

the mixing was asymmetric. Many thanks to Soren Kuula for noticing this!
This commit is contained in:
Andrew Tridgell 2013-05-27 08:24:35 +10:00
parent c481ac8745
commit 767d9d0eb5

View File

@ -176,8 +176,10 @@ static void stabilize_stick_mixing_fbw()
// the user can direct the plane in any direction with stick
// mixing.
float roll_input = g.channel_roll.norm_input();
if (fabsf(roll_input) > 0.5f) {
if (roll_input > 0.5f) {
roll_input = (3*roll_input - 1);
} else if (roll_input < -0.5f) {
roll_input = (3*roll_input + 1);
}
nav_roll_cd += roll_input * g.roll_limit_cd;
nav_roll_cd = constrain_int32(nav_roll_cd, -g.roll_limit_cd.get(), g.roll_limit_cd.get());