WPILibC++ 2025.0.0-alpha-1-24-g6478ba6
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// THIS FILE WAS AUTO-GENERATED BY ./wpilibc/generate_hids.py. DO NOT MODIFY
6
7#pragma once
8
10
11namespace frc {
12
13class PS4Controller;
14
15namespace sim {
16
17/**
18 * Class to control a simulated PS4 controller.
19 */
21 public:
22 /**
23 * Constructs from a PS4Controller object.
24 *
25 * @param joystick controller to simulate
26 */
27 explicit PS4ControllerSim(const PS4Controller& joystick);
28
29 /**
30 * Constructs from a joystick port number.
31 *
32 * @param port port number
33 */
34 explicit PS4ControllerSim(int port);
35
36 /**
37 * Change the left X value of the controller's joystick.
38 *
39 * @param value the new value
40 */
41 void SetLeftX(double value);
42
43 /**
44 * Change the left Y value of the controller's joystick.
45 *
46 * @param value the new value
47 */
48 void SetLeftY(double value);
49
50 /**
51 * Change the right X value of the controller's joystick.
52 *
53 * @param value the new value
54 */
55 void SetRightX(double value);
56
57 /**
58 * Change the right Y value of the controller's joystick.
59 *
60 * @param value the new value
61 */
62 void SetRightY(double value);
63
64 /**
65 * Change the value of the left trigger 2 axis on the controller.
66 *
67 * @param value the new value
68 */
69 void SetL2Axis(double value);
70
71 /**
72 * Change the value of the right trigger 2 axis on the controller.
73 *
74 * @param value the new value
75 */
76 void SetR2Axis(double value);
77
78 /**
79 * Change the value of the square button on the controller.
80 *
81 * @param value the new value
82 */
83 void SetSquareButton(bool value);
84
85 /**
86 * Change the value of the cross button on the controller.
87 *
88 * @param value the new value
89 */
90 void SetCrossButton(bool value);
91
92 /**
93 * Change the value of the circle button on the controller.
94 *
95 * @param value the new value
96 */
97 void SetCircleButton(bool value);
98
99 /**
100 * Change the value of the triangle button on the controller.
101 *
102 * @param value the new value
103 */
104 void SetTriangleButton(bool value);
105
106 /**
107 * Change the value of the left trigger 1 button on the controller.
108 *
109 * @param value the new value
110 */
111 void SetL1Button(bool value);
112
113 /**
114 * Change the value of the right trigger 1 button on the controller.
115 *
116 * @param value the new value
117 */
118 void SetR1Button(bool value);
119
120 /**
121 * Change the value of the left trigger 2 button on the controller.
122 *
123 * @param value the new value
124 */
125 void SetL2Button(bool value);
126
127 /**
128 * Change the value of the right trigger 2 button on the controller.
129 *
130 * @param value the new value
131 */
132 void SetR2Button(bool value);
133
134 /**
135 * Change the value of the share button on the controller.
136 *
137 * @param value the new value
138 */
139 void SetShareButton(bool value);
140
141 /**
142 * Change the value of the options button on the controller.
143 *
144 * @param value the new value
145 */
146 void SetOptionsButton(bool value);
147
148 /**
149 * Change the value of the L3 (left stick) button on the controller.
150 *
151 * @param value the new value
152 */
153 void SetL3Button(bool value);
154
155 /**
156 * Change the value of the R3 (right stick) button on the controller.
157 *
158 * @param value the new value
159 */
160 void SetR3Button(bool value);
161
162 /**
163 * Change the value of the PlayStation button on the controller.
164 *
165 * @param value the new value
166 */
167 void SetPSButton(bool value);
168
169 /**
170 * Change the value of the touchpad button on the controller.
171 *
172 * @param value the new value
173 */
174 void SetTouchpadButton(bool value);
175
176 /**
177 * Change the value of the touchpad button on the controller.
178 *
179 * @param value the new value
180 */
181 [[deprecated("Use SetTouchpadButton instead")]]
182 void SetTouchpad(bool value);
183
184};
185
186} // namespace sim
187} // namespace frc
Handle input from PS4 controllers connected to the Driver Station.
Definition: PS4Controller.h:25
Class to control a simulated generic joystick.
Definition: GenericHIDSim.h:20
Class to control a simulated PS4 controller.
Definition: PS4ControllerSim.h:20
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 left trigger 2 button on the controller.
void SetL1Button(bool value)
Change the value of the left trigger 1 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 right trigger 1 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 left X value of the controller's joystick.
void SetLeftY(double value)
Change the left Y value of the controller's joystick.
void SetRightX(double value)
Change the right X value of the controller's joystick.
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 PlayStation button on the controller.
void SetL2Axis(double value)
Change the value of the left trigger 2 axis on the controller.
void SetR2Button(bool value)
Change the value of the right trigger 2 button on the controller.
void SetRightY(double value)
Change the right Y value of the controller's joystick.
void SetTouchpadButton(bool value)
Change the value of the touchpad button on the controller.
void SetR3Button(bool value)
Change the value of the R3 (right stick) button on the controller.
void SetR2Axis(double value)
Change the value of the right trigger 2 axis on the controller.
Definition: AprilTagDetector_cv.h:11