4#include <frc/XboxController.h>
5#include <frc/filter/LinearFilter.h>
6#include <units/angle.h>
20class Gamepad :
public frc::XboxController {
323 double deadband(
double input,
double deadband,
int polynomial);
337 double joystickFilterCacheSize = 5;
342 frc::LinearFilter<double> leftJoystickX = frc::LinearFilter<double>::MovingAverage(joystickFilterCacheSize);
346 frc::LinearFilter<double> rightJoystickX = frc::LinearFilter<double>::MovingAverage(joystickFilterCacheSize);
350 frc::LinearFilter<double> leftJoystickY = frc::LinearFilter<double>::MovingAverage(joystickFilterCacheSize);
354 frc::LinearFilter<double> rightJoystickY = frc::LinearFilter<double>::MovingAverage(joystickFilterCacheSize);
Wrapper class for XBox gamepads.
Definition Gamepad.h:20
bool DPadLeft()
Is the gamepad's D-pad left button pressed?
units::angle::radian_t getRightStickAngle()
Gets the angle of the right joystick in a field-relative perspective.
void setJoystickFilterCacheSize(int cacheSize)
Sets the cache size for the joystick filters.
void setDeadbandY(double deadband)
Set the Y deadband value.
double leftTrigger()
Obtain the gamepad's left trigger value.
double leftStickY(int polynomial=1)
Obtain the Y value from the gamepad's left thumb stick.
double rightStickXFiltered(int polynomial=1)
Obtain the X value from the gamepad's right thumb stick, with filtering applied.
Gamepad(int id)
Construct a new Valor Gamepad object.
bool rightStickXActive(int polynomial=1)
Is the gamepad's right X thumb stick active?
bool rightStickYActive(int polynomial=1)
Is the gamepad's right Y thumb stick active?
double rightStickYFiltered(int polynomial=1)
Obtain the Y value from the gamepad's right thumb stick, with filtering applied.
bool DPadRight()
Is the gamepad's D-pad right button pressed?
bool leftStickXActive(int polynomial=1)
Is the gamepad's left X thumb stick active?
bool rightTriggerActive()
Is the gamepad's right trigger active?
bool DPadUp()
Is the gamepad's D-pad up button pressed?
void setDeadbandX(double deadband)
Set the X deadband value.
units::angle::radian_t getLeftStickAngle()
Gets the angle of the left joystick in a field-relative perspective.
bool getLeftStickButton()
Get the state of the left stick button.
double leftStickXFiltered(int polynomial=1)
Obtain the X value from the gamepad's left thumb stick, with filtering applied.
bool leftStickYActive(int polynomial=1)
Is the gamepad's left Y thumb stick active?
double rightStickX(int polynomial=1)
Obtain the X value from the gamepad's right thumb stick.
double rightTrigger()
Obtain the gamepad's right trigger value.
bool leftTriggerActive()
Is the gamepad's left trigger active?
double leftStickYFiltered(int polynomial=1)
Obtain the Y value from the gamepad's left thumb stick, with filtering applied.
double rightStickY(int polynomial=1)
Obtain the Y value from the gamepad's right thumb stick.
bool getRightStickButton()
Get the state of the right stick button.
void setRumble(bool turnOn, double intensity=.25)
Sets the rumble for the gamepad.
double leftStickX(int polynomial=1)
Obtain the X value from the gamepad's left thumb stick.
bool DPadDown()
Is the gamepad's D-pad down button pressed?