WPILibC++ 2024.3.2
CommandStadiaController.h
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#pragma once
7
8#include "Trigger.h"
10
11namespace frc2 {
12/**
13 * A version of {@link StadiaController} with {@link Trigger} factories for
14 * command-based.
15 *
16 * @see StadiaController
17 */
19 public:
20 using StadiaController::StadiaController;
21
22 /**
23 * Constructs an event instance around this button's digital signal.
24 *
25 * @param button the button index
26 * @param loop the event loop instance to attach the event to. Defaults to the
27 * CommandScheduler's default loop.
28 * @return an event instance representing the button's digital signal attached
29 * to the given loop.
30 */
31 Trigger Button(int button,
33 .GetDefaultButtonLoop()) const;
34
35 /**
36 * Constructs an event instance around the left bumper's digital signal.
37 *
38 * @param loop the event loop instance to attach the event to. Defaults to the
39 * CommandScheduler's default loop.
40 * @return an event instance representing the left bumper's digital signal
41 * attached to the given loop.
42 */
44 .GetDefaultButtonLoop()) const;
45
46 /**
47 * Constructs an event instance around the right bumper's digital signal.
48 *
49 * @param loop the event loop instance to attach the event to. Defaults to the
50 * CommandScheduler's default loop.
51 * @return an event instance representing the right bumper's digital signal
52 * attached to the given loop.
53 */
55 .GetDefaultButtonLoop()) const;
56
57 /**
58 * Constructs an event instance around the left stick's digital signal.
59 *
60 * @param loop the event loop instance to attach the event to. Defaults to the
61 * CommandScheduler's default loop.
62 * @return an event instance representing the left stick's digital signal
63 * attached to the given loop.
64 */
66 .GetDefaultButtonLoop()) const;
67
68 /**
69 * Constructs an event instance around the right stick's digital signal.
70 *
71 * @param loop the event loop instance to attach the event to. Defaults to the
72 * CommandScheduler's default loop.
73 * @return an event instance representing the right stick's digital signal
74 * attached to the given loop.
75 */
77 .GetDefaultButtonLoop()) const;
78
79 /**
80 * Constructs an event instance around the A button's digital signal.
81 *
82 * @param loop the event loop instance to attach the event to. Defaults to the
83 * CommandScheduler's default loop.
84 * @return an event instance representing the A button's digital signal
85 * attached to the given loop.
86 */
88 CommandScheduler::GetInstance().GetDefaultButtonLoop()) const;
89
90 /**
91 * Constructs an event instance around the B button's digital signal.
92 *
93 * @param loop the event loop instance to attach the event to. Defaults to the
94 * CommandScheduler's default loop.
95 * @return an event instance representing the B button's digital signal
96 * attached to the given loop.
97 */
99 CommandScheduler::GetInstance().GetDefaultButtonLoop()) const;
100
101 /**
102 * Constructs an event instance around the X button's digital signal.
103 *
104 * @param loop the event loop instance to attach the event to. Defaults to the
105 * CommandScheduler's default loop.
106 * @return an event instance representing the X button's digital signal
107 * attached to the given loop.
108 */
110 CommandScheduler::GetInstance().GetDefaultButtonLoop()) const;
111
112 /**
113 * Constructs an event instance around the Y button's digital signal.
114 *
115 * @param loop the event loop instance to attach the event to. Defaults to the
116 * CommandScheduler's default loop.
117 * @return an event instance representing the Y button's digital signal
118 * attached to the given loop.
119 */
121 CommandScheduler::GetInstance().GetDefaultButtonLoop()) const;
122
123 /**
124 * Constructs an event instance around the ellipses button's digital signal.
125 *
126 * @param loop the event loop instance to attach the event to. Defaults to the
127 * CommandScheduler's default loop.
128 * @return an event instance representing the ellipses button's digital signal
129 * attached to the given loop.
130 */
132 .GetDefaultButtonLoop()) const;
133
134 /**
135 * Constructs an event instance around the hamburger button's digital signal.
136 *
137 * @param loop the event loop instance to attach the event to. Defaults to the
138 * CommandScheduler's default loop.
139 * @return an event instance representing the hamburger button's digital
140 * signal attached to the given loop.
141 */
143 .GetDefaultButtonLoop()) const;
144
145 /**
146 * Constructs an event instance around the stadia button's digital signal.
147 *
148 * @param loop the event loop instance to attach the event to. Defaults to the
149 * CommandScheduler's default loop.
150 * @return an event instance representing the stadia button's digital signal
151 * attached to the given loop.
152 */
154 .GetDefaultButtonLoop()) const;
155
156 /**
157 * Constructs an event instance around the google button's digital signal.
158 *
159 * @param loop the event loop instance to attach the event to. Defaults to the
160 * CommandScheduler's default loop.
161 * @return an event instance representing the google button's digital signal
162 * attached to the given loop.
163 */
165 .GetDefaultButtonLoop()) const;
166
167 /**
168 * Constructs an event instance around the frame button's digital signal.
169 *
170 * @param loop the event loop instance to attach the event to. Defaults to the
171 * CommandScheduler's default loop.
172 * @return an event instance representing the frame button's digital signal
173 * attached to the given loop.
174 */
176 .GetDefaultButtonLoop()) const;
177
178 /**
179 * Constructs an event instance around the left trigger's digital signal.
180 *
181 * @param loop the event loop instance to attach the event to. Defaults to the
182 * CommandScheduler's default loop.
183 * @return an event instance representing the left trigger's digital signal
184 * attached to the given loop.
185 */
187 .GetDefaultButtonLoop()) const;
188
189 /**
190 * Constructs an event instance around the right trigger's digital signal.
191 *
192 * @param loop the event loop instance to attach the event to. Defaults to the
193 * CommandScheduler's default loop.
194 * @return an event instance representing the right trigger's digital signal
195 * attached to the given loop.
196 */
198 frc::EventLoop* loop =
199 CommandScheduler::GetInstance().GetDefaultButtonLoop()) const;
200};
201} // namespace frc2
static CommandScheduler & GetInstance()
Returns the Scheduler instance.
A version of StadiaController with Trigger factories for command-based.
Definition: CommandStadiaController.h:18
Trigger X(frc::EventLoop *loop=CommandScheduler::GetInstance().GetDefaultButtonLoop()) const
Constructs an event instance around the X button's digital signal.
Trigger LeftBumper(frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
Constructs an event instance around the left bumper's digital signal.
Trigger Y(frc::EventLoop *loop=CommandScheduler::GetInstance().GetDefaultButtonLoop()) const
Constructs an event instance around the Y button's digital signal.
Trigger Google(frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
Constructs an event instance around the google button's digital signal.
Trigger Button(int button, frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
Constructs an event instance around this button's digital signal.
Trigger Ellipses(frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
Constructs an event instance around the ellipses button's digital signal.
Trigger LeftStick(frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
Constructs an event instance around the left stick's digital signal.
Trigger B(frc::EventLoop *loop=CommandScheduler::GetInstance().GetDefaultButtonLoop()) const
Constructs an event instance around the B button's digital signal.
Trigger LeftTrigger(frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
Constructs an event instance around the left trigger's digital signal.
Trigger Frame(frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
Constructs an event instance around the frame button's digital signal.
Trigger RightTrigger(frc::EventLoop *loop=CommandScheduler::GetInstance().GetDefaultButtonLoop()) const
Constructs an event instance around the right trigger's digital signal.
Trigger Hamburger(frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
Constructs an event instance around the hamburger button's digital signal.
Trigger Stadia(frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
Constructs an event instance around the stadia button's digital signal.
Trigger RightBumper(frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
Constructs an event instance around the right bumper's digital signal.
Trigger A(frc::EventLoop *loop=CommandScheduler::GetInstance().GetDefaultButtonLoop()) const
Constructs an event instance around the A button's digital signal.
Trigger RightStick(frc::EventLoop *loop=CommandScheduler::GetInstance() .GetDefaultButtonLoop()) const
Constructs an event instance around the right stick's digital signal.
This class provides an easy way to link commands to conditions.
Definition: Trigger.h:31
A declarative way to bind a set of actions to a loop and execute them when the loop is polled.
Definition: EventLoop.h:15
Handle input from Stadia controllers connected to the Driver Station.
Definition: StadiaController.h:20
Definition: TrapezoidProfileSubsystem.h:12