WPILibC++ 2025.0.0-alpha-1-24-g6478ba6
XboxControllerSim.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 XboxController;
14
15namespace sim {
16
17/**
18 * Class to control a simulated Xbox controller.
19 */
21 public:
22 /**
23 * Constructs from a XboxController object.
24 *
25 * @param joystick controller to simulate
26 */
27 explicit XboxControllerSim(const XboxController& joystick);
28
29 /**
30 * Constructs from a joystick port number.
31 *
32 * @param port port number
33 */
34 explicit XboxControllerSim(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 right X value of the controller's joystick.
45 *
46 * @param value the new value
47 */
48 void SetRightX(double value);
49
50 /**
51 * Change the left Y value of the controller's joystick.
52 *
53 * @param value the new value
54 */
55 void SetLeftY(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 axis on the controller.
66 *
67 * @param value the new value
68 */
69 void SetLeftTriggerAxis(double value);
70
71 /**
72 * Change the value of the right trigger axis on the controller.
73 *
74 * @param value the new value
75 */
76 void SetRightTriggerAxis(double value);
77
78 /**
79 * Change the value of the A button on the controller.
80 *
81 * @param value the new value
82 */
83 void SetAButton(bool value);
84
85 /**
86 * Change the value of the B button on the controller.
87 *
88 * @param value the new value
89 */
90 void SetBButton(bool value);
91
92 /**
93 * Change the value of the X button on the controller.
94 *
95 * @param value the new value
96 */
97 void SetXButton(bool value);
98
99 /**
100 * Change the value of the Y button on the controller.
101 *
102 * @param value the new value
103 */
104 void SetYButton(bool value);
105
106 /**
107 * Change the value of the left bumper button on the controller.
108 *
109 * @param value the new value
110 */
111 void SetLeftBumperButton(bool value);
112
113 /**
114 * Change the value of the right bumper button on the controller.
115 *
116 * @param value the new value
117 */
118 void SetRightBumperButton(bool value);
119
120 /**
121 * Change the value of the back button on the controller.
122 *
123 * @param value the new value
124 */
125 void SetBackButton(bool value);
126
127 /**
128 * Change the value of the start button on the controller.
129 *
130 * @param value the new value
131 */
132 void SetStartButton(bool value);
133
134 /**
135 * Change the value of the left stick button on the controller.
136 *
137 * @param value the new value
138 */
139 void SetLeftStickButton(bool value);
140
141 /**
142 * Change the value of the right stick button on the controller.
143 *
144 * @param value the new value
145 */
146 void SetRightStickButton(bool value);
147
148 /**
149 * Change the left bumper value of the joystick.
150 *
151 * @param value the new value
152 */
153 [[deprecated("Use SetLeftBumperButton instead")]]
154 void SetLeftBumper(bool value);
155
156 /**
157 * Change the right bumper value of the joystick.
158 *
159 * @param value the new value
160 */
161 [[deprecated("Use SetRightBumperButton instead")]]
162 void SetRightBumper(bool value);
163
164};
165
166} // namespace sim
167} // namespace frc
Handle input from Xbox controllers connected to the Driver Station.
Definition: XboxController.h:25
Class to control a simulated generic joystick.
Definition: GenericHIDSim.h:20
Class to control a simulated Xbox controller.
Definition: XboxControllerSim.h:20
XboxControllerSim(int port)
Constructs from a joystick port number.
void SetRightBumper(bool value)
Change the right bumper value of the joystick.
void SetXButton(bool value)
Change the value of the X button on the controller.
void SetLeftStickButton(bool value)
Change the value of the left stick button on the controller.
void SetLeftTriggerAxis(double value)
Change the value of the left trigger axis on the controller.
void SetBButton(bool value)
Change the value of the B button on the controller.
void SetBackButton(bool value)
Change the value of the back button on the controller.
void SetLeftBumper(bool value)
Change the left bumper value of the joystick.
void SetRightY(double value)
Change the right Y value of the controller's joystick.
void SetLeftBumperButton(bool value)
Change the value of the left bumper button on the controller.
void SetRightTriggerAxis(double value)
Change the value of the right trigger axis on the controller.
void SetRightStickButton(bool value)
Change the value of the right stick 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 SetStartButton(bool value)
Change the value of the start button on the controller.
XboxControllerSim(const XboxController &joystick)
Constructs from a XboxController object.
void SetRightX(double value)
Change the right X value of the controller's joystick.
void SetRightBumperButton(bool value)
Change the value of the right bumper button on the controller.
void SetYButton(bool value)
Change the value of the Y button on the controller.
void SetAButton(bool value)
Change the value of the A button on the controller.
Definition: AprilTagDetector_cv.h:11