Valkyrie 2026
Loading...
Searching...
No Matches
valor::Gamepad Class Reference

Enhanced wrapper around frc::XboxController. More...

#include <valkyrie/Gamepad.h>

Inheritance diagram for valor::Gamepad:

Classes

class  AnalogValue
 Represents a processed analog controller input. More...

Public Member Functions

 Gamepad (int id)
 Construct a new Valor Gamepad object.
bool DPadUp () const
 Is the gamepad's D-pad up button pressed?
bool DPadDown () const
 Is the gamepad's D-pad down button pressed?
bool DPadLeft () const
 Is the gamepad's D-pad left button pressed?
bool DPadRight () const
 Is the gamepad's D-pad right button pressed?
constexpr AnalogValue & LeftStickX ()
 Gets the processed left stick X-axis input.
constexpr const AnalogValue & LeftStickX () const
 Gets the processed left stick X-axis input.
constexpr AnalogValue & LeftStickY ()
 Gets the processed left stick Y-axis input.
constexpr const AnalogValue & LeftStickY () const
 Gets the processed left stick Y-axis input.
constexpr AnalogValue & RightStickX ()
 Gets the processed right stick X-axis input.
constexpr const AnalogValue & RightStickX () const
 Gets the processed right stick X-axis input.
constexpr AnalogValue & RightStickY ()
 Gets the processed right stick Y-axis input.
constexpr const AnalogValue & RightStickY () const
 Gets the processed right stick Y-axis input.
constexpr AnalogValue & LeftTrigger ()
 Gets the processed left trigger input.
constexpr const AnalogValue & LeftTrigger () const
 Gets the processed left trigger input.
constexpr AnalogValue & RightTrigger ()
 Gets the processed right trigger input.
constexpr const AnalogValue & RightTrigger () const
 Gets the processed right trigger input.

Detailed Description

Enhanced wrapper around frc::XboxController.

Provides utility functions and higher-level abstractions for Xbox gamepad input handling in robot code. This class extends the default WPILib XboxController API with:

  • Processed analog stick and trigger inputs
  • Configurable deadbands
  • Polynomial response curves
  • Moving-average filtering
  • Simplified D-pad helpers
  • Convenience rumble control

Constructor & Destructor Documentation

◆ Gamepad()

valor::Gamepad::Gamepad ( int id)
explicit

Construct a new Valor Gamepad object.

Parameters
idUSB ID that shows up on the driver station. Between 0 and 3

Member Function Documentation

◆ DPadDown()

bool valor::Gamepad::DPadDown ( ) const
inline

Is the gamepad's D-pad down button pressed?

Returns
true Gamepad's down d-pad button is pressed
true Gamepad's down d-pad button is not pressed

◆ DPadLeft()

bool valor::Gamepad::DPadLeft ( ) const
inline

Is the gamepad's D-pad left button pressed?

Returns
true Gamepad's left d-pad button is pressed
true Gamepad's left d-pad button is not pressed

◆ DPadRight()

bool valor::Gamepad::DPadRight ( ) const
inline

Is the gamepad's D-pad right button pressed?

Returns
true Gamepad's right d-pad button is pressed
true Gamepad's right d-pad button is not pressed

◆ DPadUp()

bool valor::Gamepad::DPadUp ( ) const
inline

Is the gamepad's D-pad up button pressed?

Returns
true Gamepad's up d-pad button is pressed
true Gamepad's up d-pad button is not pressed

◆ LeftStickX() [1/2]

AnalogValue & valor::Gamepad::LeftStickX ( )
inlineconstexpr

Gets the processed left stick X-axis input.

Returns
Reference to the left stick X AnalogValue.

◆ LeftStickX() [2/2]

const AnalogValue & valor::Gamepad::LeftStickX ( ) const
inlineconstexpr

Gets the processed left stick X-axis input.

Returns
Const reference to the left stick X AnalogValue.

◆ LeftStickY() [1/2]

AnalogValue & valor::Gamepad::LeftStickY ( )
inlineconstexpr

Gets the processed left stick Y-axis input.

Returns
Reference to the left stick Y AnalogValue.

◆ LeftStickY() [2/2]

const AnalogValue & valor::Gamepad::LeftStickY ( ) const
inlineconstexpr

Gets the processed left stick Y-axis input.

Returns
Const reference to the left stick Y AnalogValue.

◆ LeftTrigger() [1/2]

AnalogValue & valor::Gamepad::LeftTrigger ( )
inlineconstexpr

Gets the processed left trigger input.

Returns
Reference to the left trigger AnalogValue.

◆ LeftTrigger() [2/2]

const AnalogValue & valor::Gamepad::LeftTrigger ( ) const
inlineconstexpr

Gets the processed left trigger input.

Returns
Const reference to the left trigger AnalogValue.

◆ RightStickX() [1/2]

AnalogValue & valor::Gamepad::RightStickX ( )
inlineconstexpr

Gets the processed right stick X-axis input.

Returns
Reference to the right stick X AnalogValue.

◆ RightStickX() [2/2]

const AnalogValue & valor::Gamepad::RightStickX ( ) const
inlineconstexpr

Gets the processed right stick X-axis input.

Returns
Const reference to the right stick X AnalogValue.

◆ RightStickY() [1/2]

AnalogValue & valor::Gamepad::RightStickY ( )
inlineconstexpr

Gets the processed right stick Y-axis input.

Returns
Reference to the right stick Y AnalogValue.

◆ RightStickY() [2/2]

const AnalogValue & valor::Gamepad::RightStickY ( ) const
inlineconstexpr

Gets the processed right stick Y-axis input.

Returns
Const reference to the right stick Y AnalogValue.

◆ RightTrigger() [1/2]

AnalogValue & valor::Gamepad::RightTrigger ( )
inlineconstexpr

Gets the processed right trigger input.

Returns
Reference to the right trigger AnalogValue.

◆ RightTrigger() [2/2]

const AnalogValue & valor::Gamepad::RightTrigger ( ) const
inlineconstexpr

Gets the processed right trigger input.

Returns
Const reference to the right trigger AnalogValue.

The documentation for this class was generated from the following file: