From adba7973233ac75c9c369451be89117843197658 Mon Sep 17 00:00:00 2001 From: Bart Slinger Date: Sun, 1 Oct 2017 23:52:15 +0200 Subject: [PATCH] Helicopter mixer scale throttle to -1 .. +1 Not sure why it worked for me without this change. I cannot test it myself. Should fix https://github.com/PX4/Firmware/issues/8013 --- src/modules/systemlib/mixer/mixer_helicopter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/systemlib/mixer/mixer_helicopter.cpp b/src/modules/systemlib/mixer/mixer_helicopter.cpp index 3baf911df1..aacada87ab 100644 --- a/src/modules/systemlib/mixer/mixer_helicopter.cpp +++ b/src/modules/systemlib/mixer/mixer_helicopter.cpp @@ -252,7 +252,7 @@ HelicopterMixer::mix(float *outputs, unsigned space) /* Local throttle curve gradient and offset */ float tg = (_mixer_info.throttle_curve[idx + 1] - _mixer_info.throttle_curve[idx]) / 0.25f; float to = (_mixer_info.throttle_curve[idx]) - (tg * idx * 0.25f); - float throttle = constrain((tg * thrust_cmd + to), 0.0f, 1.0f); + float throttle = constrain(2.0f * (tg * thrust_cmd + to) - 1.0f, -1.0f, 1.0f); /* Local pitch curve gradient and offset */ float pg = (_mixer_info.pitch_curve[idx + 1] - _mixer_info.pitch_curve[idx]) / 0.25f;