![]() |
WPILibC++ 2027.0.0-alpha-2
|
Class to control a simulated joystick. More...
#include <frc/simulation/JoystickSim.h>
Public Member Functions | |
| JoystickSim (const Joystick &joystick) | |
| Constructs from a Joystick object. | |
| JoystickSim (int port) | |
| Constructs from a joystick port number. | |
| void | SetX (double value) |
| Set the X value of the joystick. | |
| void | SetY (double value) |
| Set the Y value of the joystick. | |
| void | SetZ (double value) |
| Set the Z value of the joystick. | |
| void | SetTwist (double value) |
| Set the twist value of the joystick. | |
| void | SetThrottle (double value) |
| Set the throttle value of the joystick. | |
| void | SetTrigger (bool state) |
| Set the trigger value of the joystick. | |
| void | SetTop (bool state) |
| Set the top state 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, DriverStation::POVDirection value) |
| Set the value of a given POV. | |
| void | SetPOV (DriverStation::POVDirection 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 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 |