RobotCore 1.0
WPILib port to raspberry Pi
Loading...
Searching...
No Matches
robotCore.JoystickBase Class Reference

The Joystick class read the joystick connected to the driver station. More...

Inheritance diagram for robotCore.JoystickBase:
robotCore.GenericHID

Public Member Functions

 JoystickBase (int id)
void getAllJoystickData (int stick, float[] axesArray, short[] rawAxesArray, byte[] povsArray, float[] touchpadFingersArray, long[] buttonsAndMetadata)
boolean isGamepad ()
double getX ()
double getY ()
double getRX ()
double getRY ()
double getThrottle ()
double getTwist ()
double getPOV ()
boolean getRawButton (final int button)

Detailed Description

The Joystick class read the joystick connected to the driver station.

Author
John Gaby

The joystick is connected to the driver station and communicates with RobotCore via a network connection which it uses to send the current joystick x and y positions as well as the state of the buttons.

Definition at line 33 of file JoystickBase.java.

Constructor & Destructor Documentation

◆ JoystickBase()

robotCore.JoystickBase.JoystickBase ( int id)
Parameters
id- This is currently unused, but is provided for compatibility with the wpilib library.

Definition at line 73 of file JoystickBase.java.

Member Function Documentation

◆ getAllJoystickData()

void robotCore.JoystickBase.getAllJoystickData ( int stick,
float[] axesArray,
short[] rawAxesArray,
byte[] povsArray,
float[] touchpadFingersArray,
long[] buttonsAndMetadata )

Definition at line 78 of file JoystickBase.java.

◆ getPOV()

double robotCore.JoystickBase.getPOV ( )
Returns
Returns the value for the 8 position switch on the gamepad. It will return 8 descrete values in the range 0.0 to 1.0.

Definition at line 185 of file JoystickBase.java.

◆ getRawButton()

boolean robotCore.JoystickBase.getRawButton ( final int button)
Returns
Returns true if the specified button is currently pressed, and false if it is not.

Reimplemented from robotCore.GenericHID.

Definition at line 194 of file JoystickBase.java.

◆ getRX()

double robotCore.JoystickBase.getRX ( )
Returns
Returns the current horizontal position of the right joystick on a gamepad.
The value returned will be between -1.0 and +1.0.

Definition at line 147 of file JoystickBase.java.

◆ getRY()

double robotCore.JoystickBase.getRY ( )
Returns
Returns the current vertical position of the right joystick on a gamepad.
The value returned will be between -1.0 and +1.0.

Definition at line 156 of file JoystickBase.java.

◆ getThrottle()

double robotCore.JoystickBase.getThrottle ( )
Returns
Returns the current trottle position of the joystick.
The value returned will be between -1.0 and +1.0. This value also retrieves the value of the left and right analog switches on the front of the gamepad. The left switch returns a value in the range 0.0 to 1.0, and the right switch returns a value in the range of -1.0 to 0.0.

Definition at line 168 of file JoystickBase.java.

◆ getTwist()

double robotCore.JoystickBase.getTwist ( )
Returns
Returns the current twist position of the joystick.
The value returned will be between -1.0 and +1.0.

Definition at line 177 of file JoystickBase.java.

◆ getX()

double robotCore.JoystickBase.getX ( )
Returns
Returns the current horizontal position of the joystick. The value returned will be between -1.0 and +1.0.

Reimplemented from robotCore.GenericHID.

Definition at line 129 of file JoystickBase.java.

◆ getY()

double robotCore.JoystickBase.getY ( )
Returns
Returns the current vertical position of the joystick. The value returned will be between -1.0 and +1.0.

Reimplemented from robotCore.GenericHID.

Definition at line 138 of file JoystickBase.java.

◆ isGamepad()

boolean robotCore.JoystickBase.isGamepad ( )
Returns
Returns true if the attached joystick is a gamepad.

Definition at line 119 of file JoystickBase.java.


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