![]() |
WPILibC++ 2025.3.2
|
Class to control a simulated Xbox controller. More...
#include <frc/simulation/XboxControllerSim.h>
Public Member Functions | |
| XboxControllerSim (const XboxController &joystick) | |
| Constructs from a XboxController object. | |
| XboxControllerSim (int port) | |
| Constructs from a joystick port number. | |
| void | SetLeftX (double value) |
| Change the left X value of the controller's joystick. | |
| void | SetRightX (double value) |
| Change the right X value of the controller's joystick. | |
| void | SetLeftY (double value) |
| Change the left Y value of the controller's joystick. | |
| void | SetRightY (double value) |
| Change the right Y value of the controller's joystick. | |
| void | SetLeftTriggerAxis (double value) |
| Change the value of the left trigger axis on the controller. | |
| void | SetRightTriggerAxis (double value) |
| Change the value of the right trigger axis on the controller. | |
| void | SetAButton (bool value) |
| Change the value of the A button on the controller. | |
| void | SetBButton (bool value) |
| Change the value of the B button on the controller. | |
| void | SetXButton (bool value) |
| Change the value of the X button on the controller. | |
| void | SetYButton (bool value) |
| Change the value of the Y button on the controller. | |
| void | SetLeftBumperButton (bool value) |
| Change the value of the left bumper button on the controller. | |
| void | SetRightBumperButton (bool value) |
| Change the value of the right bumper button on the controller. | |
| void | SetBackButton (bool value) |
| Change the value of the back button on the controller. | |
| void | SetStartButton (bool value) |
| Change the value of the start button on the controller. | |
| void | SetLeftStickButton (bool value) |
| Change the value of the left stick button on the controller. | |
| void | SetRightStickButton (bool value) |
| Change the value of the right stick button on the controller. | |
| void | SetLeftBumper (bool value) |
| Change the left bumper value of the joystick. | |
| void | SetRightBumper (bool value) |
| Change the right bumper value of the joystick. | |
Public Member Functions inherited from frc::sim::GenericHIDSim | |
| GenericHIDSim (const GenericHID &joystick) | |
| Constructs from a GenericHID object. | |
| GenericHIDSim (int port) | |
| Constructs from a joystick port number. | |
| void | NotifyNewData () |
| Updates joystick data so that new values are visible to the user program. | |
| void | SetRawButton (int button, bool value) |
| Set the value of a given button. | |
| void | SetRawAxis (int axis, double value) |
| Set the value of a given axis. | |
| void | SetPOV (int pov, int value) |
| Set the value of a given POV. | |
| void | SetPOV (int value) |
| Set the value of the default POV (port 0). | |
| void | SetAxisCount (int count) |
| Set the axis count of this device. | |
| void | SetPOVCount (int count) |
| Set the POV count of this device. | |
| void | SetButtonCount (int count) |
| Set the button count of this device. | |
| void | SetType (GenericHID::HIDType type) |
| Set the type of this device. | |
| void | SetName (const char *name) |
| Set the name of this device. | |
| void | SetAxisType (int axis, int type) |
| Set the type of an axis. | |
| bool | GetOutput (int outputNumber) |
| Read the output of a button. | |
| int64_t | GetOutputs () |
| Get the encoded 16-bit integer that passes button values. | |
| double | GetRumble (GenericHID::RumbleType type) |
| Get the joystick rumble. | |
Additional Inherited Members | |
Protected Attributes inherited from frc::sim::GenericHIDSim | |
| int | m_port |
| GenericHID port. | |
Class to control a simulated Xbox controller.
|
explicit |
Constructs from a XboxController object.
| joystick | controller to simulate |
|
explicit |
Constructs from a joystick port number.
| port | port number |
| void frc::sim::XboxControllerSim::SetAButton | ( | bool | value | ) |
Change the value of the A button on the controller.
| value | the new value |
| void frc::sim::XboxControllerSim::SetBackButton | ( | bool | value | ) |
Change the value of the back button on the controller.
| value | the new value |
| void frc::sim::XboxControllerSim::SetBButton | ( | bool | value | ) |
Change the value of the B button on the controller.
| value | the new value |
| void frc::sim::XboxControllerSim::SetLeftBumper | ( | bool | value | ) |
Change the left bumper value of the joystick.
| value | the new value |
| void frc::sim::XboxControllerSim::SetLeftBumperButton | ( | bool | value | ) |
Change the value of the left bumper button on the controller.
| value | the new value |
| void frc::sim::XboxControllerSim::SetLeftStickButton | ( | bool | value | ) |
Change the value of the left stick button on the controller.
| value | the new value |
| void frc::sim::XboxControllerSim::SetLeftTriggerAxis | ( | double | value | ) |
Change the value of the left trigger axis on the controller.
| value | the new value |
| void frc::sim::XboxControllerSim::SetLeftX | ( | double | value | ) |
Change the left X value of the controller's joystick.
| value | the new value |
| void frc::sim::XboxControllerSim::SetLeftY | ( | double | value | ) |
Change the left Y value of the controller's joystick.
| value | the new value |
| void frc::sim::XboxControllerSim::SetRightBumper | ( | bool | value | ) |
Change the right bumper value of the joystick.
| value | the new value |
| void frc::sim::XboxControllerSim::SetRightBumperButton | ( | bool | value | ) |
Change the value of the right bumper button on the controller.
| value | the new value |
| void frc::sim::XboxControllerSim::SetRightStickButton | ( | bool | value | ) |
Change the value of the right stick button on the controller.
| value | the new value |
| void frc::sim::XboxControllerSim::SetRightTriggerAxis | ( | double | value | ) |
Change the value of the right trigger axis on the controller.
| value | the new value |
| void frc::sim::XboxControllerSim::SetRightX | ( | double | value | ) |
Change the right X value of the controller's joystick.
| value | the new value |
| void frc::sim::XboxControllerSim::SetRightY | ( | double | value | ) |
Change the right Y value of the controller's joystick.
| value | the new value |
| void frc::sim::XboxControllerSim::SetStartButton | ( | bool | value | ) |
Change the value of the start button on the controller.
| value | the new value |
| void frc::sim::XboxControllerSim::SetXButton | ( | bool | value | ) |
Change the value of the X button on the controller.
| value | the new value |
| void frc::sim::XboxControllerSim::SetYButton | ( | bool | value | ) |
Change the value of the Y button on the controller.
| value | the new value |