WPILibC++ 2023.4.3
PS4ControllerSim.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
6
8
9namespace frc {
10
11class PS4Controller;
12
13namespace sim {
14
15/**
16 * Class to control a simulated PS4 controller.
17 */
19 public:
20 /**
21 * Constructs from a PS4Controller object.
22 *
23 * @param joystick controller to simulate
24 */
25 explicit PS4ControllerSim(const PS4Controller& joystick);
26
27 /**
28 * Constructs from a joystick port number.
29 *
30 * @param port port number
31 */
32 explicit PS4ControllerSim(int port);
33
34 /**
35 * Change the X axis value of the controller's left stick.
36 *
37 * @param value the new value
38 */
39 void SetLeftX(double value);
40
41 /**
42 * Change the X axis value of the controller's right stick.
43 *
44 * @param value the new value
45 */
46 void SetRightX(double value);
47
48 /**
49 * Change the Y axis value of the controller's left stick.
50 *
51 * @param value the new value
52 */
53 void SetLeftY(double value);
54
55 /**
56 * Change the Y axis value of the controller's right stick.
57 *
58 * @param value the new value
59 */
60 void SetRightY(double value);
61
62 /**
63 * Change the L2 axis axis value of the controller.
64 *
65 * @param value the new value
66 */
67 void SetL2Axis(double value);
68
69 /**
70 * Change the R2 axis value of the controller.
71 *
72 * @param value the new value
73 */
74 void SetR2Axis(double value);
75
76 /**
77 * Change the value of the Square button on the controller.
78 *
79 * @param value the new value
80 */
82
83 /**
84 * Change the value of the Cross button on the controller.
85 *
86 * @param value the new value
87 */
89
90 /**
91 * Change the value of the Circle button on the controller.
92 *
93 * @param value the new value
94 */
96
97 /**
98 * Change the value of the Triangle button on the controller.
99 *
100 * @param value the new value
101 */
103
104 /**
105 * Change the value of the L1 button on the controller.
106 *
107 * @param value the new value
108 */
109 void SetL1Button(bool value);
110
111 /**
112 * Change the value of the R1 button on the controller.
113 *
114 * @param value the new value
115 */
116 void SetR1Button(bool value);
117
118 /**
119 * Change the value of the L2 button on the controller.
120 *
121 * @param value the new value
122 */
123 void SetL2Button(bool value);
124
125 /**
126 * Change the value of the R2 button on the controller.
127 *
128 * @param value the new value
129 */
130 void SetR2Button(bool value);
131
132 /**
133 * Change the value of the Share button on the controller.
134 *
135 * @param value the new value
136 */
138
139 /**
140 * Change the value of the Options button on the controller.
141 *
142 * @param value the new value
143 */
145
146 /**
147 * Change the value of the L3 (left stick) button on the controller.
148 *
149 * @param value the new value
150 */
151 void SetL3Button(bool value);
152
153 /**
154 * Change the value of the R3 (right stick) button on the controller.
155 *
156 * @param value the new value
157 */
158 void SetR3Button(bool value);
159
160 /**
161 * Change the value of the PS button on the controller.
162 *
163 * @param value the new value
164 */
165 void SetPSButton(bool value);
166
167 /**
168 * Change the value of the touchpad button on the controller.
169 *
170 * @param value the new value
171 */
172 void SetTouchpad(bool value);
173};
174
175} // namespace sim
176} // namespace frc
Handle input from PS4 controllers connected to the Driver Station.
Definition: PS4Controller.h:19
Class to control a simulated generic joystick.
Definition: GenericHIDSim.h:20
Class to control a simulated PS4 controller.
Definition: PS4ControllerSim.h:18
void SetL3Button(bool value)
Change the value of the L3 (left stick) button on the controller.
void SetCrossButton(bool value)
Change the value of the Cross button on the controller.
void SetL2Button(bool value)
Change the value of the L2 button on the controller.
void SetL1Button(bool value)
Change the value of the L1 button on the controller.
void SetOptionsButton(bool value)
Change the value of the Options button on the controller.
void SetR1Button(bool value)
Change the value of the R1 button on the controller.
void SetCircleButton(bool value)
Change the value of the Circle button on the controller.
void SetTouchpad(bool value)
Change the value of the touchpad button on the controller.
void SetLeftX(double value)
Change the X axis value of the controller's left stick.
void SetLeftY(double value)
Change the Y axis value of the controller's left stick.
void SetRightX(double value)
Change the X axis value of the controller's right stick.
void SetTriangleButton(bool value)
Change the value of the Triangle button on the controller.
PS4ControllerSim(int port)
Constructs from a joystick port number.
PS4ControllerSim(const PS4Controller &joystick)
Constructs from a PS4Controller object.
void SetSquareButton(bool value)
Change the value of the Square button on the controller.
void SetShareButton(bool value)
Change the value of the Share button on the controller.
void SetPSButton(bool value)
Change the value of the PS button on the controller.
void SetL2Axis(double value)
Change the L2 axis axis value of the controller.
void SetR2Button(bool value)
Change the value of the R2 button on the controller.
void SetRightY(double value)
Change the Y axis value of the controller's right stick.
void SetR3Button(bool value)
Change the value of the R3 (right stick) button on the controller.
void SetR2Axis(double value)
Change the R2 axis value of the controller.
Definition: core.h:1240
Definition: AprilTagFieldLayout.h:22