373 uint16_t m_leftRumble = 0;
374 uint16_t m_rightRumble = 0;
This class provides an easy way to link actions to inputs.
Definition: BooleanEvent.h:31
A declarative way to bind a set of actions to a loop and execute them when the loop is polled.
Definition: EventLoop.h:15
Handle input from standard HID devices connected to the Driver Station.
Definition: GenericHID.h:24
double GetRawAxis(int axis) const
Get the value of the axis.
BooleanEvent POVUpLeft(EventLoop *loop) const
Constructs a BooleanEvent instance based around the 315 degree angle (left up) of the default (index ...
GenericHID::HIDType GetType() const
Get the type of the HID.
BooleanEvent POVCenter(EventLoop *loop) const
Constructs a BooleanEvent instance based around the center (not pressed) of the default (index 0) POV...
BooleanEvent POVDown(EventLoop *loop) const
Constructs a BooleanEvent instance based around the 180 degree angle (down) of the default (index 0) ...
virtual ~GenericHID()=default
BooleanEvent POVUp(EventLoop *loop) const
Constructs a BooleanEvent instance based around the 0 degree angle (up) of the default (index 0) POV ...
BooleanEvent POV(int pov, int angle, EventLoop *loop) const
Constructs a BooleanEvent instance based around this angle of a POV on the HID.
BooleanEvent POVRight(EventLoop *loop) const
Constructs a BooleanEvent instance based around the 90 degree angle (right) of the default (index 0) ...
int GetAxisType(int axis) const
Get the axis type of a joystick axis.
bool GetRawButton(int button) const
Get the button value (starting at button 1).
BooleanEvent POVUpRight(EventLoop *loop) const
Constructs a BooleanEvent instance based around the 45 degree angle (right up) of the default (index ...
BooleanEvent AxisGreaterThan(int axis, double threshold, EventLoop *loop) const
Constructs an event instance that is true when the axis value is greater than threshold.
BooleanEvent AxisLessThan(int axis, double threshold, EventLoop *loop) const
Constructs an event instance that is true when the axis value is less than threshold.
RumbleType
Represents a rumble output on the Joystick.
Definition: GenericHID.h:29
@ kBothRumble
Both left and right rumble motors.
Definition: GenericHID.h:35
@ kLeftRumble
Left rumble motor.
Definition: GenericHID.h:31
@ kRightRumble
Right rumble motor.
Definition: GenericHID.h:33
int GetPOVCount() const
Get the number of POVs for the HID.
int GetPort() const
Get the port number of the HID.
void SetOutputs(int value)
Set all output values for the HID.
BooleanEvent Button(int button, EventLoop *loop) const
Constructs an event instance around this button's digital signal.
bool IsConnected() const
Get if the HID is connected.
GenericHID(GenericHID &&)=default
GenericHID & operator=(GenericHID &&)=default
void SetOutput(int outputNumber, bool value)
Set a single HID output value for the HID.
BooleanEvent POVLeft(EventLoop *loop) const
Constructs a BooleanEvent instance based around the 270 degree angle (left) of the default (index 0) ...
HIDType
USB HID interface type.
Definition: GenericHID.h:41
@ kXInputArcadeStick
XInputArcadeStick.
Definition: GenericHID.h:51
@ kXInputDrumKit
XInputDrumKit.
Definition: GenericHID.h:61
@ kHIDJoystick
HIDJoystick.
Definition: GenericHID.h:67
@ kHIDGamepad
HIDGamepad.
Definition: GenericHID.h:69
@ kXInputWheel
XInputWheel.
Definition: GenericHID.h:49
@ kHID1stPerson
HID1stPerson.
Definition: GenericHID.h:75
@ kXInputGuitar
XInputGuitar.
Definition: GenericHID.h:57
@ kXInputFlightStick
XInputFlightStick.
Definition: GenericHID.h:53
@ kXInputArcadePad
XInputArcadePad.
Definition: GenericHID.h:65
@ kUnknown
Unknown.
Definition: GenericHID.h:43
@ kHIDFlight
HIDFlight.
Definition: GenericHID.h:73
@ kXInputGuitar3
XInputGuitar3.
Definition: GenericHID.h:63
@ kXInputGuitar2
XInputGuitar2.
Definition: GenericHID.h:59
@ kXInputDancePad
XInputDancePad.
Definition: GenericHID.h:55
@ kHIDDriving
HIDDriving.
Definition: GenericHID.h:71
@ kXInputGamepad
XInputGamepad.
Definition: GenericHID.h:47
@ kXInputUnknown
XInputUnknown.
Definition: GenericHID.h:45
int GetButtonCount() const
Get the number of buttons for the HID.
int GetPOV(int pov=0) const
Get the angle in degrees of a POV on the HID.
bool GetRawButtonPressed(int button)
Whether the button was pressed since the last check.
std::string GetName() const
Get the name of the HID.
BooleanEvent POV(int angle, EventLoop *loop) const
Constructs a BooleanEvent instance based around this angle of a POV on the HID.
BooleanEvent POVDownRight(EventLoop *loop) const
Constructs a BooleanEvent instance based around the 135 degree angle (right down) of the default (ind...
void SetRumble(RumbleType type, double value)
Set the rumble output for the HID.
int GetAxisCount() const
Get the number of axes for the HID.
bool GetRawButtonReleased(int button)
Whether the button was released since the last check.
BooleanEvent POVDownLeft(EventLoop *loop) const
Constructs a BooleanEvent instance based around the 225 degree angle (down left) of the default (inde...
type
Definition: core.h:556
Definition: AprilTagPoseEstimator.h:15