WPILibC++ 2024.3.2-83-g9ed2f66
frc2::CommandStadiaController Class Reference

A version of StadiaController with Trigger factories for command-based. More...

#include <frc2/command/button/CommandStadiaController.h>

Inheritance diagram for frc2::CommandStadiaController:
frc::StadiaController frc::GenericHID

Public Member Functions

Trigger Button (int button, frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs an event instance around this button's digital signal. More...
 
Trigger LeftBumper (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs an event instance around the left bumper's digital signal. More...
 
Trigger RightBumper (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs an event instance around the right bumper's digital signal. More...
 
Trigger LeftStick (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs an event instance around the left stick's digital signal. More...
 
Trigger RightStick (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs an event instance around the right stick's digital signal. More...
 
Trigger A (frc::EventLoop *loop=CommandScheduler::GetInstance().GetDefaultButtonLoop()) const
 Constructs an event instance around the A button's digital signal. More...
 
Trigger B (frc::EventLoop *loop=CommandScheduler::GetInstance().GetDefaultButtonLoop()) const
 Constructs an event instance around the B button's digital signal. More...
 
Trigger X (frc::EventLoop *loop=CommandScheduler::GetInstance().GetDefaultButtonLoop()) const
 Constructs an event instance around the X button's digital signal. More...
 
Trigger Y (frc::EventLoop *loop=CommandScheduler::GetInstance().GetDefaultButtonLoop()) const
 Constructs an event instance around the Y button's digital signal. More...
 
Trigger Ellipses (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs an event instance around the ellipses button's digital signal. More...
 
Trigger Hamburger (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs an event instance around the hamburger button's digital signal. More...
 
Trigger Stadia (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs an event instance around the stadia button's digital signal. More...
 
Trigger Google (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs an event instance around the google button's digital signal. More...
 
Trigger Frame (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs an event instance around the frame button's digital signal. More...
 
Trigger LeftTrigger (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs an event instance around the left trigger's digital signal. More...
 
Trigger RightTrigger (frc::EventLoop *loop=CommandScheduler::GetInstance().GetDefaultButtonLoop()) const
 Constructs an event instance around the right trigger's digital signal. More...
 
- Public Member Functions inherited from frc::StadiaController
 StadiaController (int port)
 Construct an instance of a Stadia controller. More...
 
 ~StadiaController () override=default
 
 StadiaController (StadiaController &&)=default
 
StadiaControlleroperator= (StadiaController &&)=default
 
double GetLeftX () const
 Get the X axis value of left side of the controller. More...
 
double GetRightX () const
 Get the X axis value of right side of the controller. More...
 
double GetLeftY () const
 Get the Y axis value of left side of the controller. More...
 
double GetRightY () const
 Get the Y axis value of right side of the controller. More...
 
bool GetLeftBumper () const
 Read the value of the left bumper (LB) button on the controller. More...
 
bool GetRightBumper () const
 Read the value of the right bumper (RB) button on the controller. More...
 
bool GetLeftBumperPressed ()
 Whether the left bumper (LB) was pressed since the last check. More...
 
bool GetRightBumperPressed ()
 Whether the right bumper (RB) was pressed since the last check. More...
 
bool GetLeftBumperReleased ()
 Whether the left bumper (LB) was released since the last check. More...
 
bool GetRightBumperReleased ()
 Whether the right bumper (RB) was released since the last check. More...
 
BooleanEvent LeftBumper (EventLoop *loop) const
 Constructs an event instance around the left bumper's digital signal. More...
 
BooleanEvent RightBumper (EventLoop *loop) const
 Constructs an event instance around the right bumper's digital signal. More...
 
bool GetLeftStickButton () const
 Read the value of the left stick button (LSB) on the controller. More...
 
bool GetRightStickButton () const
 Read the value of the right stick button (RSB) on the controller. More...
 
bool GetLeftStickButtonPressed ()
 Whether the left stick button (LSB) was pressed since the last check. More...
 
bool GetRightStickButtonPressed ()
 Whether the right stick button (RSB) was pressed since the last check. More...
 
bool GetLeftStickButtonReleased ()
 Whether the left stick button (LSB) was released since the last check. More...
 
bool GetRightStickButtonReleased ()
 Whether the right stick button (RSB) was released since the last check. More...
 
BooleanEvent LeftStick (EventLoop *loop) const
 Constructs an event instance around the left stick's digital signal. More...
 
BooleanEvent RightStick (EventLoop *loop) const
 Constructs an event instance around the right stick's digital signal. More...
 
bool GetAButton () const
 Read the value of the A button on the controller. More...
 
bool GetAButtonPressed ()
 Whether the A button was pressed since the last check. More...
 
bool GetAButtonReleased ()
 Whether the A button was released since the last check. More...
 
BooleanEvent A (EventLoop *loop) const
 Constructs an event instance around the A button's digital signal. More...
 
bool GetBButton () const
 Read the value of the B button on the controller. More...
 
bool GetBButtonPressed ()
 Whether the B button was pressed since the last check. More...
 
bool GetBButtonReleased ()
 Whether the B button was released since the last check. More...
 
BooleanEvent B (EventLoop *loop) const
 Constructs an event instance around the B button's digital signal. More...
 
bool GetXButton () const
 Read the value of the X button on the controller. More...
 
bool GetXButtonPressed ()
 Whether the X button was pressed since the last check. More...
 
bool GetXButtonReleased ()
 Whether the X button was released since the last check. More...
 
BooleanEvent X (EventLoop *loop) const
 Constructs an event instance around the X button's digital signal. More...
 
bool GetYButton () const
 Read the value of the Y button on the controller. More...
 
bool GetYButtonPressed ()
 Whether the Y button was pressed since the last check. More...
 
bool GetYButtonReleased ()
 Whether the Y button was released since the last check. More...
 
BooleanEvent Y (EventLoop *loop) const
 Constructs an event instance around the Y button's digital signal. More...
 
bool GetEllipsesButton () const
 Read the value of the ellipses button on the controller. More...
 
bool GetEllipsesButtonPressed ()
 Whether the ellipses button was pressed since the last check. More...
 
bool GetEllipsesButtonReleased ()
 Whether the ellipses button was released since the last check. More...
 
BooleanEvent Ellipses (EventLoop *loop) const
 Constructs an event instance around the ellipses button's digital signal. More...
 
bool GetHamburgerButton () const
 Read the value of the hamburger button on the controller. More...
 
bool GetHamburgerButtonPressed ()
 Whether the hamburger button was pressed since the last check. More...
 
bool GetHamburgerButtonReleased ()
 Whether the hamburger button was released since the last check. More...
 
BooleanEvent Hamburger (EventLoop *loop) const
 Constructs an event instance around the hamburger button's digital signal. More...
 
bool GetStadiaButton () const
 Read the value of the stadia button on the controller. More...
 
bool GetStadiaButtonPressed ()
 Whether the stadia button was pressed since the last check. More...
 
bool GetStadiaButtonReleased ()
 Whether the stadia button was released since the last check. More...
 
BooleanEvent Stadia (EventLoop *loop) const
 Constructs an event instance around the stadia button's digital signal. More...
 
bool GetGoogleButton () const
 Read the value of the google button on the controller. More...
 
bool GetGoogleButtonPressed ()
 Whether the google button was pressed since the last check. More...
 
bool GetGoogleButtonReleased ()
 Whether the google button was released since the last check. More...
 
BooleanEvent Google (EventLoop *loop) const
 Constructs an event instance around the google button's digital signal. More...
 
bool GetFrameButton () const
 Read the value of the frame button on the controller. More...
 
bool GetFrameButtonPressed ()
 Whether the frame button was pressed since the last check. More...
 
bool GetFrameButtonReleased ()
 Whether the frame button was released since the last check. More...
 
BooleanEvent Frame (EventLoop *loop) const
 Constructs an event instance around the frame button's digital signal. More...
 
bool GetLeftTriggerButton () const
 Read the value of the left trigger button on the controller. More...
 
bool GetLeftTriggerButtonPressed ()
 Whether the left trigger button was pressed since the last check. More...
 
bool GetLeftTriggerButtonReleased ()
 Whether the left trigger button was released since the last check. More...
 
BooleanEvent LeftTrigger (EventLoop *loop) const
 Constructs an event instance around the left trigger button's digital signal. More...
 
bool GetRightTriggerButton () const
 Read the value of the right trigger button on the controller. More...
 
bool GetRightTriggerButtonPressed ()
 Whether the right trigger button was pressed since the last check. More...
 
bool GetRightTriggerButtonReleased ()
 Whether the right trigger button was released since the last check. More...
 
BooleanEvent RightTrigger (EventLoop *loop) const
 Constructs an event instance around the right trigger button's digital signal. More...
 
- Public Member Functions inherited from frc::GenericHID
 GenericHID (int port)
 
virtual ~GenericHID ()=default
 
 GenericHID (GenericHID &&)=default
 
GenericHIDoperator= (GenericHID &&)=default
 
bool GetRawButton (int button) const
 Get the button value (starting at button 1). More...
 
bool GetRawButtonPressed (int button)
 Whether the button was pressed since the last check. More...
 
bool GetRawButtonReleased (int button)
 Whether the button was released since the last check. More...
 
BooleanEvent Button (int button, EventLoop *loop) const
 Constructs an event instance around this button's digital signal. More...
 
double GetRawAxis (int axis) const
 Get the value of the axis. More...
 
int GetPOV (int pov=0) const
 Get the angle in degrees of a POV on the HID. More...
 
BooleanEvent POV (int angle, EventLoop *loop) const
 Constructs a BooleanEvent instance based around this angle of a POV on the HID. More...
 
BooleanEvent POV (int pov, int angle, EventLoop *loop) const
 Constructs a BooleanEvent instance based around this angle of a POV on the HID. More...
 
BooleanEvent POVUp (EventLoop *loop) const
 Constructs a BooleanEvent instance based around the 0 degree angle (up) of the default (index 0) POV on the HID. More...
 
BooleanEvent POVUpRight (EventLoop *loop) const
 Constructs a BooleanEvent instance based around the 45 degree angle (right up) of the default (index 0) POV on the HID. More...
 
BooleanEvent POVRight (EventLoop *loop) const
 Constructs a BooleanEvent instance based around the 90 degree angle (right) of the default (index 0) POV on the HID. More...
 
BooleanEvent POVDownRight (EventLoop *loop) const
 Constructs a BooleanEvent instance based around the 135 degree angle (right down) of the default (index 0) POV on the HID. More...
 
BooleanEvent POVDown (EventLoop *loop) const
 Constructs a BooleanEvent instance based around the 180 degree angle (down) of the default (index 0) POV on the HID. More...
 
BooleanEvent POVDownLeft (EventLoop *loop) const
 Constructs a BooleanEvent instance based around the 225 degree angle (down left) of the default (index 0) POV on the HID. More...
 
BooleanEvent POVLeft (EventLoop *loop) const
 Constructs a BooleanEvent instance based around the 270 degree angle (left) of the default (index 0) POV on the HID. More...
 
BooleanEvent POVUpLeft (EventLoop *loop) const
 Constructs a BooleanEvent instance based around the 315 degree angle (left up) of the default (index 0) POV on the HID. More...
 
BooleanEvent POVCenter (EventLoop *loop) const
 Constructs a BooleanEvent instance based around the center (not pressed) of the default (index 0) POV on the HID. More...
 
BooleanEvent AxisLessThan (int axis, double threshold, EventLoop *loop) const
 Constructs an event instance that is true when the axis value is less than threshold. More...
 
BooleanEvent AxisGreaterThan (int axis, double threshold, EventLoop *loop) const
 Constructs an event instance that is true when the axis value is greater than threshold. More...
 
int GetAxisCount () const
 Get the number of axes for the HID. More...
 
int GetPOVCount () const
 Get the number of POVs for the HID. More...
 
int GetButtonCount () const
 Get the number of buttons for the HID. More...
 
bool IsConnected () const
 Get if the HID is connected. More...
 
GenericHID::HIDType GetType () const
 Get the type of the HID. More...
 
std::string GetName () const
 Get the name of the HID. More...
 
int GetAxisType (int axis) const
 Get the axis type of a joystick axis. More...
 
int GetPort () const
 Get the port number of the HID. More...
 
void SetOutput (int outputNumber, bool value)
 Set a single HID output value for the HID. More...
 
void SetOutputs (int value)
 Set all output values for the HID. More...
 
void SetRumble (RumbleType type, double value)
 Set the rumble output for the HID. More...
 

Additional Inherited Members

- Public Types inherited from frc::GenericHID
enum  RumbleType { kLeftRumble , kRightRumble , kBothRumble }
 Represents a rumble output on the Joystick. More...
 
enum  HIDType {
  kUnknown = -1 , kXInputUnknown = 0 , kXInputGamepad = 1 , kXInputWheel = 2 ,
  kXInputArcadeStick = 3 , kXInputFlightStick = 4 , kXInputDancePad = 5 , kXInputGuitar = 6 ,
  kXInputGuitar2 = 7 , kXInputDrumKit = 8 , kXInputGuitar3 = 11 , kXInputArcadePad = 19 ,
  kHIDJoystick = 20 , kHIDGamepad = 21 , kHIDDriving = 22 , kHIDFlight = 23 ,
  kHID1stPerson = 24
}
 USB HID interface type. More...
 

Detailed Description

A version of StadiaController with Trigger factories for command-based.

See also
StadiaController

Member Function Documentation

◆ A()

Trigger frc2::CommandStadiaController::A ( frc::EventLoop loop = CommandScheduler::GetInstance().GetDefaultButtonLoop()) const

Constructs an event instance around the A button's digital signal.

Parameters
loopthe event loop instance to attach the event to. Defaults to the CommandScheduler's default loop.
Returns
an event instance representing the A button's digital signal attached to the given loop.

◆ B()

Trigger frc2::CommandStadiaController::B ( frc::EventLoop loop = CommandScheduler::GetInstance().GetDefaultButtonLoop()) const

Constructs an event instance around the B button's digital signal.

Parameters
loopthe event loop instance to attach the event to. Defaults to the CommandScheduler's default loop.
Returns
an event instance representing the B button's digital signal attached to the given loop.

◆ Button()

Trigger frc2::CommandStadiaController::Button ( int  button,
frc::EventLoop loop = CommandScheduler::GetInstance() .GetDefaultButtonLoop() 
) const

Constructs an event instance around this button's digital signal.

Parameters
buttonthe button index
loopthe event loop instance to attach the event to. Defaults to the CommandScheduler's default loop.
Returns
an event instance representing the button's digital signal attached to the given loop.

◆ Ellipses()

Trigger frc2::CommandStadiaController::Ellipses ( frc::EventLoop loop = CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const

Constructs an event instance around the ellipses button's digital signal.

Parameters
loopthe event loop instance to attach the event to. Defaults to the CommandScheduler's default loop.
Returns
an event instance representing the ellipses button's digital signal attached to the given loop.

◆ Frame()

Trigger frc2::CommandStadiaController::Frame ( frc::EventLoop loop = CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const

Constructs an event instance around the frame button's digital signal.

Parameters
loopthe event loop instance to attach the event to. Defaults to the CommandScheduler's default loop.
Returns
an event instance representing the frame button's digital signal attached to the given loop.

◆ Google()

Trigger frc2::CommandStadiaController::Google ( frc::EventLoop loop = CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const

Constructs an event instance around the google button's digital signal.

Parameters
loopthe event loop instance to attach the event to. Defaults to the CommandScheduler's default loop.
Returns
an event instance representing the google button's digital signal attached to the given loop.

◆ Hamburger()

Trigger frc2::CommandStadiaController::Hamburger ( frc::EventLoop loop = CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const

Constructs an event instance around the hamburger button's digital signal.

Parameters
loopthe event loop instance to attach the event to. Defaults to the CommandScheduler's default loop.
Returns
an event instance representing the hamburger button's digital signal attached to the given loop.

◆ LeftBumper()

Trigger frc2::CommandStadiaController::LeftBumper ( frc::EventLoop loop = CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const

Constructs an event instance around the left bumper's digital signal.

Parameters
loopthe event loop instance to attach the event to. Defaults to the CommandScheduler's default loop.
Returns
an event instance representing the left bumper's digital signal attached to the given loop.

◆ LeftStick()

Trigger frc2::CommandStadiaController::LeftStick ( frc::EventLoop loop = CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const

Constructs an event instance around the left stick's digital signal.

Parameters
loopthe event loop instance to attach the event to. Defaults to the CommandScheduler's default loop.
Returns
an event instance representing the left stick's digital signal attached to the given loop.

◆ LeftTrigger()

Trigger frc2::CommandStadiaController::LeftTrigger ( frc::EventLoop loop = CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const

Constructs an event instance around the left trigger's digital signal.

Parameters
loopthe event loop instance to attach the event to. Defaults to the CommandScheduler's default loop.
Returns
an event instance representing the left trigger's digital signal attached to the given loop.

◆ RightBumper()

Trigger frc2::CommandStadiaController::RightBumper ( frc::EventLoop loop = CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const

Constructs an event instance around the right bumper's digital signal.

Parameters
loopthe event loop instance to attach the event to. Defaults to the CommandScheduler's default loop.
Returns
an event instance representing the right bumper's digital signal attached to the given loop.

◆ RightStick()

Trigger frc2::CommandStadiaController::RightStick ( frc::EventLoop loop = CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const

Constructs an event instance around the right stick's digital signal.

Parameters
loopthe event loop instance to attach the event to. Defaults to the CommandScheduler's default loop.
Returns
an event instance representing the right stick's digital signal attached to the given loop.

◆ RightTrigger()

Trigger frc2::CommandStadiaController::RightTrigger ( frc::EventLoop loop = CommandScheduler::GetInstance().GetDefaultButtonLoop()) const

Constructs an event instance around the right trigger's digital signal.

Parameters
loopthe event loop instance to attach the event to. Defaults to the CommandScheduler's default loop.
Returns
an event instance representing the right trigger's digital signal attached to the given loop.

◆ Stadia()

Trigger frc2::CommandStadiaController::Stadia ( frc::EventLoop loop = CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const

Constructs an event instance around the stadia button's digital signal.

Parameters
loopthe event loop instance to attach the event to. Defaults to the CommandScheduler's default loop.
Returns
an event instance representing the stadia button's digital signal attached to the given loop.

◆ X()

Trigger frc2::CommandStadiaController::X ( frc::EventLoop loop = CommandScheduler::GetInstance().GetDefaultButtonLoop()) const

Constructs an event instance around the X button's digital signal.

Parameters
loopthe event loop instance to attach the event to. Defaults to the CommandScheduler's default loop.
Returns
an event instance representing the X button's digital signal attached to the given loop.

◆ Y()

Trigger frc2::CommandStadiaController::Y ( frc::EventLoop loop = CommandScheduler::GetInstance().GetDefaultButtonLoop()) const

Constructs an event instance around the Y button's digital signal.

Parameters
loopthe event loop instance to attach the event to. Defaults to the CommandScheduler's default loop.
Returns
an event instance representing the Y button's digital signal attached to the given loop.

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