diff --git a/src/modules/flight_mode_manager/tasks/Utility/Sticks.cpp b/src/modules/flight_mode_manager/tasks/Utility/Sticks.cpp index a3890968b6..f0104a7612 100644 --- a/src/modules/flight_mode_manager/tasks/Utility/Sticks.cpp +++ b/src/modules/flight_mode_manager/tasks/Utility/Sticks.cpp @@ -44,7 +44,7 @@ Sticks::Sticks(ModuleParams *parent) : ModuleParams(parent) {} -bool Sticks::checkAndSetStickInputs() +bool Sticks::checkAndUpdateStickInputs() { // Sticks are rescaled linearly and exponentially to [-1,1] manual_control_setpoint_s manual_control_setpoint; diff --git a/src/modules/flight_mode_manager/tasks/Utility/Sticks.hpp b/src/modules/flight_mode_manager/tasks/Utility/Sticks.hpp index dae247f97c..00246807d2 100644 --- a/src/modules/flight_mode_manager/tasks/Utility/Sticks.hpp +++ b/src/modules/flight_mode_manager/tasks/Utility/Sticks.hpp @@ -53,11 +53,20 @@ public: Sticks(ModuleParams *parent); ~Sticks() = default; - bool checkAndSetStickInputs(); + // Checks for updated manual control input & updates internal values + bool checkAndUpdateStickInputs(); + bool isAvailable() { return _input_available; }; + + // Position : 0 : pitch, 1 : roll, 2 : throttle, 3 : yaw const matrix::Vector &getPosition() { return _positions; }; const matrix::Vector &getPositionExpo() { return _positions_expo; }; + // Helper functions to get stick values more intuitively + float getPitch() { return _positions(0); } + float getRoll() { return _positions(1); } + float getThrottle() { return _positions(2); } + float getYaw() { return _positions(3); } /** * Limit the the horizontal input from a square shaped joystick gimbal to a unit circle