WPILibC++ 2024.3.2
frc::sim::XboxControllerSim Class Reference

Class to control a simulated Xbox 360 or Xbox One controller. More...

#include <frc/simulation/XboxControllerSim.h>

Inheritance diagram for frc::sim::XboxControllerSim:
frc::sim::GenericHIDSim

Public Member Functions

 XboxControllerSim (const XboxController &joystick)
 Constructs from a XboxController object. More...
 
 XboxControllerSim (int port)
 Constructs from a joystick port number. More...
 
void SetLeftX (double value)
 Change the X axis value of the controller's left stick. More...
 
void SetRightX (double value)
 Change the X axis value of the controller's right stick. More...
 
void SetLeftY (double value)
 Change the Y axis value of the controller's left stick. More...
 
void SetRightY (double value)
 Change the Y axis value of the controller's right stick. More...
 
void SetLeftTriggerAxis (double value)
 Change the left trigger axis value of the joystick. More...
 
void SetRightTriggerAxis (double value)
 Change the right trigger axis value of the joystick. More...
 
void SetLeftBumper (bool value)
 Change the left bumper value of the joystick. More...
 
void SetRightBumper (bool value)
 Change the right bumper value of the joystick. More...
 
void SetLeftStickButton (bool value)
 Change the left button value of the joystick. More...
 
void SetRightStickButton (bool value)
 Change the right button value of the joystick. More...
 
void SetAButton (bool value)
 Change the value of the A button. More...
 
void SetBButton (bool value)
 Change the value of the B button. More...
 
void SetXButton (bool value)
 Change the value of the X button. More...
 
void SetYButton (bool value)
 Change the value of the Y button. More...
 
void SetBackButton (bool value)
 Change the value of the Back button. More...
 
void SetStartButton (bool value)
 Change the value of the Start button. More...
 
- Public Member Functions inherited from frc::sim::GenericHIDSim
 GenericHIDSim (const GenericHID &joystick)
 Constructs from a GenericHID object. More...
 
 GenericHIDSim (int port)
 Constructs from a joystick port number. More...
 
void NotifyNewData ()
 Updates joystick data so that new values are visible to the user program. More...
 
void SetRawButton (int button, bool value)
 Set the value of a given button. More...
 
void SetRawAxis (int axis, double value)
 Set the value of a given axis. More...
 
void SetPOV (int pov, int value)
 Set the value of a given POV. More...
 
void SetPOV (int value)
 Set the value of the default POV (port 0). More...
 
void SetAxisCount (int count)
 Set the axis count of this device. More...
 
void SetPOVCount (int count)
 Set the POV count of this device. More...
 
void SetButtonCount (int count)
 Set the button count of this device. More...
 
void SetType (GenericHID::HIDType type)
 Set the type of this device. More...
 
void SetName (const char *name)
 Set the name of this device. More...
 
void SetAxisType (int axis, int type)
 Set the type of an axis. More...
 
bool GetOutput (int outputNumber)
 Read the output of a button. More...
 
int64_t GetOutputs ()
 Get the encoded 16-bit integer that passes button values. More...
 
double GetRumble (GenericHID::RumbleType type)
 Get the joystick rumble. More...
 

Additional Inherited Members

- Protected Attributes inherited from frc::sim::GenericHIDSim
int m_port
 GenericHID port. More...
 

Detailed Description

Class to control a simulated Xbox 360 or Xbox One controller.

Constructor & Destructor Documentation

◆ XboxControllerSim() [1/2]

frc::sim::XboxControllerSim::XboxControllerSim ( const XboxController joystick)
explicit

Constructs from a XboxController object.

Parameters
joystickcontroller to simulate

◆ XboxControllerSim() [2/2]

frc::sim::XboxControllerSim::XboxControllerSim ( int  port)
explicit

Constructs from a joystick port number.

Parameters
portport number

Member Function Documentation

◆ SetAButton()

void frc::sim::XboxControllerSim::SetAButton ( bool  value)

Change the value of the A button.

Parameters
valuethe new value

◆ SetBackButton()

void frc::sim::XboxControllerSim::SetBackButton ( bool  value)

Change the value of the Back button.

Parameters
valuethe new value

◆ SetBButton()

void frc::sim::XboxControllerSim::SetBButton ( bool  value)

Change the value of the B button.

Parameters
valuethe new value

◆ SetLeftBumper()

void frc::sim::XboxControllerSim::SetLeftBumper ( bool  value)

Change the left bumper value of the joystick.

Parameters
valuethe new value

◆ SetLeftStickButton()

void frc::sim::XboxControllerSim::SetLeftStickButton ( bool  value)

Change the left button value of the joystick.

Parameters
valuethe new value

◆ SetLeftTriggerAxis()

void frc::sim::XboxControllerSim::SetLeftTriggerAxis ( double  value)

Change the left trigger axis value of the joystick.

Parameters
valuethe new value

◆ SetLeftX()

void frc::sim::XboxControllerSim::SetLeftX ( double  value)

Change the X axis value of the controller's left stick.

Parameters
valuethe new value

◆ SetLeftY()

void frc::sim::XboxControllerSim::SetLeftY ( double  value)

Change the Y axis value of the controller's left stick.

Parameters
valuethe new value

◆ SetRightBumper()

void frc::sim::XboxControllerSim::SetRightBumper ( bool  value)

Change the right bumper value of the joystick.

Parameters
valuethe new value

◆ SetRightStickButton()

void frc::sim::XboxControllerSim::SetRightStickButton ( bool  value)

Change the right button value of the joystick.

Parameters
valuethe new value

◆ SetRightTriggerAxis()

void frc::sim::XboxControllerSim::SetRightTriggerAxis ( double  value)

Change the right trigger axis value of the joystick.

Parameters
valuethe new value

◆ SetRightX()

void frc::sim::XboxControllerSim::SetRightX ( double  value)

Change the X axis value of the controller's right stick.

Parameters
valuethe new value

◆ SetRightY()

void frc::sim::XboxControllerSim::SetRightY ( double  value)

Change the Y axis value of the controller's right stick.

Parameters
valuethe new value

◆ SetStartButton()

void frc::sim::XboxControllerSim::SetStartButton ( bool  value)

Change the value of the Start button.

Parameters
valuethe new value

◆ SetXButton()

void frc::sim::XboxControllerSim::SetXButton ( bool  value)

Change the value of the X button.

Parameters
valuethe new value

◆ SetYButton()

void frc::sim::XboxControllerSim::SetYButton ( bool  value)

Change the value of the Y button.

Parameters
valuethe new value

The documentation for this class was generated from the following file: