From 146f0cafe0cc8d3066570455933a66fffbacd7cf Mon Sep 17 00:00:00 2001 From: Junwoo Hwang Date: Thu, 5 May 2022 14:29:55 +0200 Subject: [PATCH] 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. --- src/modules/flight_mode_manager/tasks/Utility/Sticks.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/flight_mode_manager/tasks/Utility/Sticks.hpp b/src/modules/flight_mode_manager/tasks/Utility/Sticks.hpp index 263fa3d761..723375f379 100644 --- a/src/modules/flight_mode_manager/tasks/Utility/Sticks.hpp +++ b/src/modules/flight_mode_manager/tasks/Utility/Sticks.hpp @@ -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