Commit 05de83b6 authored by Julian Oes's avatar Julian Oes

JoystickInput: only send 0-1 for throttle channel

parent 5ca377c3
...@@ -480,15 +480,18 @@ void JoystickInput::run() ...@@ -480,15 +480,18 @@ void JoystickInput::run()
axisValue = 1.0f - axisValue; axisValue = 1.0f - axisValue;
// For non-throttle axes or if the UAS can reverse, go ahead and convert this into the range [-1:1]. // For non-throttle axes or if the UAS can reverse, go ahead and convert this into the range [-1:1].
if (uasCanReverse || throttleAxis != i)
//if (uasCanReverse || throttleAxis != i)
// don't take into account if UAS can reverse. This means to reverse position but not throttle
// therefore deactivated for now
if (throttleAxis != i)
{ {
axisValue = axisValue * 2.0f - 1.0f; axisValue = axisValue * 2.0f - 1.0f;
} }
// Otherwise if this vehicle can only go forward, but the axis is limited to only the positive range, // Otherwise if this vehicle can only go forward, scale it to [0:1].
// scale this so the negative values are ignored for this axis and it's clamped to [0:1].
else if (throttleAxis == i && joystickSettings[autopilotType][systemType].axesLimited.value(i)) else if (throttleAxis == i && joystickSettings[autopilotType][systemType].axesLimited.value(i))
{ {
axisValue = axisValue * 2.0f - 1.0f; axisValue = (axisValue);
if (axisValue < 0.0f) if (axisValue < 0.0f)
{ {
axisValue = 0.0f; axisValue = 0.0f;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment