WPILibC++ 2025.2.1
Loading...
Searching...
No Matches
frc2::CommandStadiaController Class Reference

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

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

Inheritance diagram for frc2::CommandStadiaController:
frc2::CommandGenericHID

Public Member Functions

 CommandStadiaController (int port)
 Construct an instance of a controller.
 
frc::StadiaControllerGetHID ()
 Get the underlying GenericHID object.
 
Trigger A (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance around the A button's digital signal.
 
Trigger B (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance around the B button's digital signal.
 
Trigger X (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance around the X button's digital signal.
 
Trigger Y (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance around the Y button's digital signal.
 
Trigger LeftBumper (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance around the left bumper button's digital signal.
 
Trigger RightBumper (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance around the right bumper button's digital signal.
 
Trigger LeftStick (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance around the left stick button's digital signal.
 
Trigger RightStick (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance around the right stick button's digital signal.
 
Trigger Ellipses (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance around the ellipses button's digital signal.
 
Trigger Hamburger (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance around the hamburger button's digital signal.
 
Trigger Stadia (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance around the stadia button's digital signal.
 
Trigger RightTrigger (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance around the right trigger button's digital signal.
 
Trigger LeftTrigger (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance around the left trigger button's digital signal.
 
Trigger Google (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance around the google button's digital signal.
 
Trigger Frame (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance around the frame button's digital signal.
 
double GetLeftX () const
 Get the X axis value of left side of the controller.
 
double GetRightX () const
 Get the X axis value of right side of the controller.
 
double GetLeftY () const
 Get the Y axis value of left side of the controller.
 
double GetRightY () const
 Get the Y axis value of right side of the controller.
 
- Public Member Functions inherited from frc2::CommandGenericHID
 CommandGenericHID (int port)
 Construct an instance of a device.
 
frc::GenericHIDGetHID ()
 Get the underlying GenericHID object.
 
Trigger Button (int button, frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs an event instance around this button's digital signal.
 
Trigger POV (int angle, frc::EventLoop *loop=CommandScheduler::GetInstance().GetDefaultButtonLoop()) const
 Constructs a Trigger instance based around this angle of a POV on the HID.
 
Trigger POV (int pov, int angle, frc::EventLoop *loop=CommandScheduler::GetInstance().GetDefaultButtonLoop()) const
 Constructs a Trigger instance based around this angle of a POV on the HID.
 
Trigger POVUp (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance based around the 0 degree angle (up) of the default (index 0) POV on the HID.
 
Trigger POVUpRight (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance based around the 45 degree angle (right up) of the default (index 0) POV on the HID.
 
Trigger POVRight (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance based around the 90 degree angle (right) of the default (index 0) POV on the HID.
 
Trigger POVDownRight (frc::EventLoop *loop=CommandScheduler::GetInstance().GetDefaultButtonLoop()) const
 Constructs a Trigger instance based around the 135 degree angle (right down) of the default (index 0) POV on the HID.
 
Trigger POVDown (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance based around the 180 degree angle (down) of the default (index 0) POV on the HID.
 
Trigger POVDownLeft (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance based around the 225 degree angle (down left) of the default (index 0) POV on the HID.
 
Trigger POVLeft (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance based around the 270 degree angle (left) of the default (index 0) POV on the HID.
 
Trigger POVUpLeft (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance based around the 315 degree angle (left up) of the default (index 0) POV on the HID.
 
Trigger POVCenter (frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance based around the center (not pressed) position of the default (index 0) POV on the HID.
 
Trigger AxisLessThan (int axis, double threshold, frc::EventLoop *loop=CommandScheduler::GetInstance().GetDefaultButtonLoop()) const
 Constructs a Trigger instance that is true when the axis value is less than threshold, attached to the default command scheduler button loop.
 
Trigger AxisGreaterThan (int axis, double threshold, frc::EventLoop *loop=CommandScheduler::GetInstance().GetDefaultButtonLoop()) const
 Constructs a Trigger instance that is true when the axis value is greater than threshold, attached to the default command scheduler button loop.
 
Trigger AxisMagnitudeGreaterThan (int axis, double threshold, frc::EventLoop *loop=CommandScheduler::GetInstance().GetDefaultButtonLoop()) const
 Constructs a Trigger instance that is true when the axis magnitude value is greater than threshold, attached to the given loop.
 
void SetRumble (frc::GenericHID::RumbleType type, double value)
 Set the rumble output for the HID.
 
bool IsConnected () const
 Get if the HID is connected.
 

Detailed Description

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

See also
frc::StadiaController

Constructor & Destructor Documentation

◆ CommandStadiaController()

frc2::CommandStadiaController::CommandStadiaController ( int port)
explicit

Construct an instance of a controller.

Parameters
portThe port index on the Driver Station that the controller is plugged into.

Member Function Documentation

◆ A()

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

Constructs a Trigger 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
a Trigger 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 a Trigger 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
a Trigger instance representing the B button's digital signal attached to the given loop.

◆ Ellipses()

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

Constructs a Trigger 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
a Trigger 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 a Trigger 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
a Trigger instance representing the frame button's digital signal attached to the given loop.

◆ GetHID()

frc::StadiaController & frc2::CommandStadiaController::GetHID ( )

Get the underlying GenericHID object.

Returns
the wrapped GenericHID object

◆ GetLeftX()

double frc2::CommandStadiaController::GetLeftX ( ) const

Get the X axis value of left side of the controller.

Returns
The axis value.

◆ GetLeftY()

double frc2::CommandStadiaController::GetLeftY ( ) const

Get the Y axis value of left side of the controller.

Returns
The axis value.

◆ GetRightX()

double frc2::CommandStadiaController::GetRightX ( ) const

Get the X axis value of right side of the controller.

Returns
The axis value.

◆ GetRightY()

double frc2::CommandStadiaController::GetRightY ( ) const

Get the Y axis value of right side of the controller.

Returns
The axis value.

◆ Google()

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

Constructs a Trigger 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
a Trigger 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 a Trigger 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
a Trigger 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 a Trigger instance around the left bumper button's digital signal.

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

◆ LeftStick()

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

Constructs a Trigger instance around the left stick button's digital signal.

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

◆ LeftTrigger()

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

Constructs a Trigger instance around the left trigger button's digital signal.

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

◆ RightBumper()

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

Constructs a Trigger instance around the right bumper button's digital signal.

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

◆ RightStick()

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

Constructs a Trigger instance around the right stick button's digital signal.

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

◆ RightTrigger()

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

Constructs a Trigger instance around the right trigger button's digital signal.

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

◆ Stadia()

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

Constructs a Trigger 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
a Trigger 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 a Trigger 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
a Trigger 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 a Trigger 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
a Trigger instance representing the Y button's digital signal attached to the given loop.

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