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.
This commit is contained in:
Junwoo Hwang 2022-05-05 14:29:55 +02:00 committed by Junwoo Hwang
parent 4bd2d4cf35
commit 146f0cafe0
1 changed files with 4 additions and 0 deletions

View File

@ -67,6 +67,10 @@ public:
float getRoll() const { return _positions(1); }
float getThrottleZeroCentered() const { return -_positions(2); } // Convert Z-axis(down) command to Up-axis frame
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