|
|
|
@ -53,11 +53,20 @@ public:
@@ -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<float, 4> &getPosition() { return _positions; }; |
|
|
|
|
const matrix::Vector<float, 4> &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 |
|
|
|
|