Robot Core Documentation
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)
 
boolean isGamepad ()
 
double getX ()
 
double getY ()
 
double getRX ()
 
double getRY ()
 
double getThrottle ()
 
double getTwist ()
 
double getPOV ()
 
boolean getRawButton (final int button)
 
- Public Member Functions inherited from robotCore.GenericHID

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.

Constructor & Destructor Documentation

◆ JoystickBase()

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

Member Function Documentation

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ 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.

◆ isGamepad()

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

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