Switch manual_control_setpoint.z scaling from [0,1] to [-1,1]

To be consistent with all other axes of stick input and avoid future
rescaling confusion.

Note: for the MAVLink message 69 MANUAL_CONTROL it's using the full range
according to the message specs now [-1000,1000].
This commit is contained in:
Matthias Grob
2020-10-12 20:03:31 +02:00
parent 5579e319ff
commit 83246c84cf
13 changed files with 38 additions and 52 deletions
@@ -53,8 +53,7 @@ bool Sticks::checkAndUpdateStickInputs()
// Linear scale
_positions(0) = manual_control_setpoint.x; // NED x, pitch [-1,1]
_positions(1) = manual_control_setpoint.y; // NED y, roll [-1,1]
_positions(2) = -(math::constrain(manual_control_setpoint.z, 0.0f,
1.0f) - 0.5f) * 2.f; // NED z, thrust resacaled from [0,1] to [-1,1]
_positions(2) = -manual_control_setpoint.z; // NED z, thrust [-1,1]
_positions(3) = manual_control_setpoint.r; // yaw [-1,1]
// Exponential scale