Skip to content
Snippets Groups Projects
Commit ee7c1cfb authored by Marcus Eliasson's avatar Marcus Eliasson
Browse files

Merge pull request #153 from Hoverbear/thrust-fix

Make sure that the Thrust is at least zero for altitude hold.
parents 7cc10430 a38db943
Branches
Tags
No related merge requests found
...@@ -324,6 +324,11 @@ class JoystickReader: ...@@ -324,6 +324,11 @@ class JoystickReader:
trimmed_roll = roll + self._trim_roll trimmed_roll = roll + self._trim_roll
trimmed_pitch = pitch + self._trim_pitch trimmed_pitch = pitch + self._trim_pitch
# Thrust might be <0 here, make sure it's not otherwise we'll get an error.
if thrust < 0:
thrust = 0
self.input_updated.call(trimmed_roll, trimmed_pitch, yaw, thrust) self.input_updated.call(trimmed_roll, trimmed_pitch, yaw, thrust)
except Exception: except Exception:
logger.warning("Exception while reading inputdevice: %s", logger.warning("Exception while reading inputdevice: %s",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment