WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
wpi::cmd::CommandNiDsStadiaController Class Reference

A version of wpi::NiDsStadiaController with Trigger factories for command-based. More...

#include <wpi/commands2/button/CommandNiDsStadiaController.hpp>

Inheritance diagram for wpi::cmd::CommandNiDsStadiaController:
wpi::cmd::CommandGenericHID

Public Member Functions

 CommandNiDsStadiaController (int port)
 Construct an instance of a controller.
wpi::NiDsStadiaControllerGetHID ()
 Get the underlying GenericHID object.
Trigger A (wpi::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance around the A button's digital signal.
Trigger B (wpi::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance around the B button's digital signal.
Trigger X (wpi::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance around the X button's digital signal.
Trigger Y (wpi::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance around the Y button's digital signal.
Trigger LeftBumper (wpi::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance around the left bumper button's digital signal.
Trigger RightBumper (wpi::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance around the right bumper button's digital signal.
Trigger LeftStick (wpi::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance around the left stick button's digital signal.
Trigger RightStick (wpi::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance around the right stick button's digital signal.
Trigger Ellipses (wpi::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance around the ellipses button's digital signal.
Trigger Hamburger (wpi::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance around the hamburger button's digital signal.
Trigger Stadia (wpi::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance around the stadia button's digital signal.
Trigger RightTrigger (wpi::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance around the right trigger button's digital signal.
Trigger LeftTrigger (wpi::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance around the left trigger button's digital signal.
Trigger Google (wpi::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance around the google button's digital signal.
Trigger Frame (wpi::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 wpi::cmd::CommandGenericHID
 CommandGenericHID (int port)
 Construct an instance of a device.
wpi::GenericHIDGetHID ()
 Get the underlying GenericHID object.
Trigger Button (int button, wpi::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs an event instance around this button's digital signal.
Trigger POV (wpi::DriverStation::POVDirection angle, wpi::EventLoop *loop=CommandScheduler::GetInstance().GetDefaultButtonLoop()) const
 Constructs a Trigger instance based around this angle of a POV on the HID.
Trigger POV (int pov, wpi::DriverStation::POVDirection angle, wpi::EventLoop *loop=CommandScheduler::GetInstance().GetDefaultButtonLoop()) const
 Constructs a Trigger instance based around this angle of a POV on the HID.
Trigger POVUp (wpi::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance based around the up direction of the default (index 0) POV on the HID.
Trigger POVUpRight (wpi::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance based around the up right direction of the default (index 0) POV on the HID.
Trigger POVRight (wpi::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance based around the right direction of the default (index 0) POV on the HID.
Trigger POVDownRight (wpi::EventLoop *loop=CommandScheduler::GetInstance().GetDefaultButtonLoop()) const
 Constructs a Trigger instance based around the down right direction of the default (index 0) POV on the HID.
Trigger POVDown (wpi::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance based around the down direction of the default (index 0) POV on the HID.
Trigger POVDownLeft (wpi::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance based around the down left direction of the default (index 0) POV on the HID.
Trigger POVLeft (wpi::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance based around the left direction of the default (index 0) POV on the HID.
Trigger POVUpLeft (wpi::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
 Constructs a Trigger instance based around the up left direction of the default (index 0) POV on the HID.
Trigger POVCenter (wpi::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, wpi::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, wpi::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, wpi::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 (wpi::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 wpi::NiDsStadiaController with Trigger factories for command-based.

See also
wpi::NiDsStadiaController

Constructor & Destructor Documentation

◆ CommandNiDsStadiaController()

wpi::cmd::CommandNiDsStadiaController::CommandNiDsStadiaController ( 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 wpi::cmd::CommandNiDsStadiaController::A ( wpi::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 wpi::cmd::CommandNiDsStadiaController::B ( wpi::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 wpi::cmd::CommandNiDsStadiaController::Ellipses ( wpi::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 wpi::cmd::CommandNiDsStadiaController::Frame ( wpi::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()

wpi::NiDsStadiaController & wpi::cmd::CommandNiDsStadiaController::GetHID ( )

Get the underlying GenericHID object.

Returns
the wrapped GenericHID object

◆ GetLeftX()

double wpi::cmd::CommandNiDsStadiaController::GetLeftX ( ) const

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

Right is positive.

Returns
The axis value.

◆ GetLeftY()

double wpi::cmd::CommandNiDsStadiaController::GetLeftY ( ) const

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

Back is positive.

Returns
The axis value.

◆ GetRightX()

double wpi::cmd::CommandNiDsStadiaController::GetRightX ( ) const

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

Right is positive.

Returns
The axis value.

◆ GetRightY()

double wpi::cmd::CommandNiDsStadiaController::GetRightY ( ) const

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

Back is positive.

Returns
The axis value.

◆ Google()

Trigger wpi::cmd::CommandNiDsStadiaController::Google ( wpi::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 wpi::cmd::CommandNiDsStadiaController::Hamburger ( wpi::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 wpi::cmd::CommandNiDsStadiaController::LeftBumper ( wpi::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 wpi::cmd::CommandNiDsStadiaController::LeftStick ( wpi::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 wpi::cmd::CommandNiDsStadiaController::LeftTrigger ( wpi::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 wpi::cmd::CommandNiDsStadiaController::RightBumper ( wpi::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 wpi::cmd::CommandNiDsStadiaController::RightStick ( wpi::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 wpi::cmd::CommandNiDsStadiaController::RightTrigger ( wpi::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 wpi::cmd::CommandNiDsStadiaController::Stadia ( wpi::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 wpi::cmd::CommandNiDsStadiaController::X ( wpi::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 wpi::cmd::CommandNiDsStadiaController::Y ( wpi::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: