WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
wpi::sim::JoystickSim Class Reference

Class to control a simulated joystick. More...

#include <wpi/simulation/JoystickSim.hpp>

Inheritance diagram for wpi::sim::JoystickSim:
wpi::sim::GenericHIDSim

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 wpi::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 SetAxesMaximumIndex (int maximumIndex)
void SetAxesAvailable (int count)
 Set the axis count of this device.
void SetPOVsMaximumIndex (int maximumIndex)
void SetPOVsAvailable (int count)
 Set the POV count of this device.
void SetButtonsMaximumIndex (int maximumIndex)
void SetButtonsAvailable (uint64_t count)
 Set the button count of this device.
void SetGamepadType (GenericHID::HIDType type)
 Set the type of this device.
void SetSupportedOutputs (GenericHID::SupportedOutputs supportedOutputs)
void SetName (const char *name)
 Set the name of this device.
int32_t GetLeds ()
 Get the value of set LEDs.
double GetRumble (GenericHID::RumbleType type)
 Get the joystick rumble.

Additional Inherited Members

Protected Attributes inherited from wpi::sim::GenericHIDSim
int m_port
 GenericHID port.

Detailed Description

Class to control a simulated joystick.

Constructor & Destructor Documentation

◆ JoystickSim() [1/2]

wpi::sim::JoystickSim::JoystickSim ( const Joystick & joystick)
explicit

Constructs from a Joystick object.

Parameters
joystickjoystick to simulate

◆ JoystickSim() [2/2]

wpi::sim::JoystickSim::JoystickSim ( int port)
explicit

Constructs from a joystick port number.

Parameters
portport number

Member Function Documentation

◆ SetThrottle()

void wpi::sim::JoystickSim::SetThrottle ( double value)

Set the throttle value of the joystick.

Parameters
valuethe new throttle value

◆ SetTop()

void wpi::sim::JoystickSim::SetTop ( bool state)

Set the top state of the joystick.

Parameters
statethe new state

◆ SetTrigger()

void wpi::sim::JoystickSim::SetTrigger ( bool state)

Set the trigger value of the joystick.

Parameters
statethe new value

◆ SetTwist()

void wpi::sim::JoystickSim::SetTwist ( double value)

Set the twist value of the joystick.

Parameters
valuethe new twist value

◆ SetX()

void wpi::sim::JoystickSim::SetX ( double value)

Set the X value of the joystick.

Parameters
valuethe new X value

◆ SetY()

void wpi::sim::JoystickSim::SetY ( double value)

Set the Y value of the joystick.

Parameters
valuethe new Y value

◆ SetZ()

void wpi::sim::JoystickSim::SetZ ( double value)

Set the Z value of the joystick.

Parameters
valuethe new Z value

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