WPILibC++ 2023.4.3-108-ge5452e3
|
Class to control a simulated joystick. More...
#include <frc/simulation/JoystickSim.h>
Public Member Functions | |
JoystickSim (const Joystick &joystick) | |
Constructs from a Joystick object. More... | |
JoystickSim (int port) | |
Constructs from a joystick port number. More... | |
void | SetX (double value) |
Set the X value of the joystick. More... | |
void | SetY (double value) |
Set the Y value of the joystick. More... | |
void | SetZ (double value) |
Set the Z value of the joystick. More... | |
void | SetTwist (double value) |
Set the twist value of the joystick. More... | |
void | SetThrottle (double value) |
Set the throttle value of the joystick. More... | |
void | SetTrigger (bool state) |
Set the trigger value of the joystick. More... | |
void | SetTop (bool state) |
Set the top state of the joystick. 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 |
Class to control a simulated joystick.
|
explicit |
Constructs from a Joystick object.
joystick | joystick to simulate |
|
explicit |
Constructs from a joystick port number.
port | port number |
void frc::sim::JoystickSim::SetThrottle | ( | double | value | ) |
Set the throttle value of the joystick.
value | the new throttle value |
void frc::sim::JoystickSim::SetTop | ( | bool | state | ) |
Set the top state of the joystick.
state | the new state |
void frc::sim::JoystickSim::SetTrigger | ( | bool | state | ) |
Set the trigger value of the joystick.
state | the new value |
void frc::sim::JoystickSim::SetTwist | ( | double | value | ) |
Set the twist value of the joystick.
value | the new twist value |
void frc::sim::JoystickSim::SetX | ( | double | value | ) |
Set the X value of the joystick.
value | the new X value |
void frc::sim::JoystickSim::SetY | ( | double | value | ) |
Set the Y value of the joystick.
value | the new Y value |
void frc::sim::JoystickSim::SetZ | ( | double | value | ) |
Set the Z value of the joystick.
value | the new Z value |