mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-01 02:41:48 +00:00
Add new joystick features
Axis counts other than six and POVs are both present in C++ and Java now Add dynamic joystick axis counts, up to 12 Change-Id: Ieade5e61a89df822df8702cb32326e4635558778 Add support for POVs in C++ Change-Id: I12dc0fcaca605a256ddcf990eebde45767229171 Make POVs work in Java Change-Id: Ie2d98adb416c1930f058bdd21c3e7d26289df503
This commit is contained in:
@@ -30,9 +30,9 @@ public:
|
||||
static DriverStation *GetInstance();
|
||||
|
||||
static const uint32_t kJoystickPorts = 4;
|
||||
static const uint32_t kJoystickAxes = 6;
|
||||
|
||||
float GetStickAxis(uint32_t stick, uint32_t axis);
|
||||
int GetStickPOV(uint32_t stick, uint32_t pov);
|
||||
short GetStickButtons(uint32_t stick);
|
||||
|
||||
bool IsEnabled();
|
||||
@@ -98,6 +98,7 @@ private:
|
||||
HALControlWord m_controlWord;
|
||||
HALAllianceStationID m_allianceStationID;
|
||||
HALJoystickAxes m_joystickAxes[kJoystickPorts];
|
||||
HALJoystickPOVs m_joystickPOVs[kJoystickPorts];
|
||||
HALJoystickButtons m_joystickButtons[kJoystickPorts];
|
||||
|
||||
MUTEX_ID m_statusDataSemaphore;
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
virtual ~Joystick();
|
||||
|
||||
uint32_t GetAxisChannel(AxisType axis);
|
||||
void SetAxisChannel(AxisType axis, uint32_t channel);
|
||||
void SetAxisChannel(AxisType axis, uint32_t channel);
|
||||
|
||||
virtual float GetX(JoystickHand hand = kRightHand);
|
||||
virtual float GetY(JoystickHand hand = kRightHand);
|
||||
@@ -55,10 +55,11 @@ public:
|
||||
virtual bool GetTrigger(JoystickHand hand = kRightHand);
|
||||
virtual bool GetTop(JoystickHand hand = kRightHand);
|
||||
virtual bool GetBumper(JoystickHand hand = kRightHand);
|
||||
virtual bool GetButton(ButtonType button);
|
||||
bool GetRawButton(uint32_t button);
|
||||
virtual bool GetRawButton(uint32_t button);
|
||||
virtual int GetPOV(uint32_t pov = 1);
|
||||
bool GetButton(ButtonType button);
|
||||
static Joystick* GetStickForPort(uint32_t port);
|
||||
|
||||
|
||||
virtual float GetMagnitude();
|
||||
virtual float GetDirectionRadians();
|
||||
virtual float GetDirectionDegrees();
|
||||
@@ -74,4 +75,3 @@ private:
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user