Browse Source

Add get*Expo() functions to the Sticks library

To return Exponential Values, which is helpful for reducing the
sensitivity of the stick around the centered value (0), since it's
exponential curve.

Useful for user adjustment implementations, where accidentally touching the stick
wouldn't have so much effect when using the Exponential value, compared
to using the raw position value.
main
Junwoo Hwang 3 years ago committed by Junwoo Hwang
parent
commit
146f0cafe0
  1. 4
      src/modules/flight_mode_manager/tasks/Utility/Sticks.hpp

4
src/modules/flight_mode_manager/tasks/Utility/Sticks.hpp

@ -67,6 +67,10 @@ public:
float getRoll() const { return _positions(1); } float getRoll() const { return _positions(1); }
float getThrottleZeroCentered() const { return -_positions(2); } // Convert Z-axis(down) command to Up-axis frame float getThrottleZeroCentered() const { return -_positions(2); } // Convert Z-axis(down) command to Up-axis frame
float getYaw() const { return _positions(3); } float getYaw() const { return _positions(3); }
float getPitchExpo() const { return _positions_expo(0); }
float getRollExpo() const { return _positions_expo(1); }
float getThrottleZeroCenteredExpo() const { return -_positions_expo(2); } // Convert Z-axis(down) command to Up-axis frame
float getYawExpo() const { return _positions_expo(3); }
/** /**
* Limit the the horizontal input from a square shaped joystick gimbal to a unit circle * Limit the the horizontal input from a square shaped joystick gimbal to a unit circle

Loading…
Cancel
Save