WPILibC++ 2024.3.2
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#pragma once
6
8
9namespace frc {
10
11class XboxController;
12
13namespace sim {
14
15/**
16 * Class to control a simulated Xbox 360 or Xbox One controller.
17 */
19 public:
20 /**
21 * Constructs from a XboxController object.
22 *
23 * @param joystick controller to simulate
24 */
25 explicit XboxControllerSim(const XboxController& joystick);
26
27 /**
28 * Constructs from a joystick port number.
29 *
30 * @param port port number
31 */
32 explicit XboxControllerSim(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 left trigger axis value of the joystick.
64 *
65 * @param value the new value
66 */
67 void SetLeftTriggerAxis(double value);
68
69 /**
70 * Change the right trigger axis value of the joystick.
71 *
72 * @param value the new value
73 */
74 void SetRightTriggerAxis(double value);
75
76 /**
77 * Change the left bumper value of the joystick.
78 *
79 * @param value the new value
80 */
81 void SetLeftBumper(bool value);
82
83 /**
84 * Change the right bumper value of the joystick.
85 *
86 * @param value the new value
87 */
88 void SetRightBumper(bool value);
89
90 /**
91 * Change the left button value of the joystick.
92 *
93 * @param value the new value
94 */
95 void SetLeftStickButton(bool value);
96
97 /**
98 * Change the right button value of the joystick.
99 *
100 * @param value the new value
101 */
102 void SetRightStickButton(bool value);
103
104 /**
105 * Change the value of the A button.
106 *
107 * @param value the new value
108 */
109 void SetAButton(bool value);
110
111 /**
112 * Change the value of the B button.
113 *
114 * @param value the new value
115 */
116 void SetBButton(bool value);
117
118 /**
119 * Change the value of the X button.
120 *
121 * @param value the new value
122 */
123 void SetXButton(bool value);
124
125 /**
126 * Change the value of the Y button.
127 *
128 * @param value the new value
129 */
130 void SetYButton(bool value);
131
132 /**
133 * Change the value of the Back button.
134 *
135 * @param value the new value
136 */
137 void SetBackButton(bool value);
138
139 /**
140 * Change the value of the Start button.
141 *
142 * @param value the new value
143 */
144 void SetStartButton(bool value);
145};
146
147} // namespace sim
148} // namespace frc
Handle input from Xbox 360 or Xbox One controllers connected to the Driver Station.
Definition: XboxController.h:24
Class to control a simulated generic joystick.
Definition: GenericHIDSim.h:20
Class to control a simulated Xbox 360 or Xbox One controller.
Definition: XboxControllerSim.h:18
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.
void SetLeftStickButton(bool value)
Change the left button value of the joystick.
void SetLeftTriggerAxis(double value)
Change the left trigger axis value of the joystick.
void SetBButton(bool value)
Change the value of the B button.
void SetBackButton(bool value)
Change the value of the Back button.
void SetLeftBumper(bool value)
Change the left bumper value of the joystick.
void SetRightY(double value)
Change the Y axis value of the controller's right stick.
void SetRightTriggerAxis(double value)
Change the right trigger axis value of the joystick.
void SetRightStickButton(bool value)
Change the right button value of the joystick.
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 SetStartButton(bool value)
Change the value of the Start button.
XboxControllerSim(const XboxController &joystick)
Constructs from a XboxController object.
void SetRightX(double value)
Change the X axis value of the controller's right stick.
void SetYButton(bool value)
Change the value of the Y button.
void SetAButton(bool value)
Change the value of the A button.
Definition: AprilTagPoseEstimator.h:15