|
RobotCore 1.0
WPILib port to raspberry Pi
|
Classes | |
| enum | AxisType |
| enum | ButtonType |
Public Member Functions | |
| GenericHID | getHID () |
| Joystick (final int port) | |
| Joystick (final GenericHID hid) | |
| void | setXChannel (int channel) |
| void | setYChannel (int channel) |
| void | setZChannel (int channel) |
| void | setThrottleChannel (int channel) |
| void | setTwistChannel (int channel) |
| int | getXChannel () |
| int | getYChannel () |
| int | getZChannel () |
| int | getTwistChannel () |
| int | getThrottleChannel () |
| boolean | getRawButton (int button) |
| boolean | getRawButtonPressed (int button) |
| boolean | getRawButtonReleased (int button) |
| double | getRawAxis (int axis) |
| POVDirection | getPOV (int pov) |
| POVDirection | getPOV () |
| final double | getX () |
| final double | getY () |
| final double | getZ () |
| final double | getTwist () |
| final double | getThrottle () |
| boolean | getTrigger () |
| boolean | getTriggerPressed () |
| boolean | getTriggerReleased () |
| BooleanEvent | trigger (EventLoop loop) |
| boolean | getTop () |
| boolean | getTopPressed () |
| boolean | getTopReleased () |
| BooleanEvent | top (EventLoop loop) |
| double | getMagnitude () |
| double | getDirectionRadians () |
| double | getDirectionDegrees () |
Static Public Attributes | |
| static final byte | DEFAULT_X_CHANNEL = 0 |
| static final byte | DEFAULT_Y_CHANNEL = 1 |
| static final byte | DEFAULT_Z_CHANNEL = 2 |
| static final byte | DEFAULT_TWIST_CHANNEL = 2 |
| static final byte | DEFAULT_THROTTLE_CHANNEL = 3 |
Additional Inherited Members | |
| Public Attributes inherited from org.wpilib.driverstation.HIDDevice | |
| int | MAX_DEVICES = DriverStationBackend.JOYSTICK_PORTS |
Handle input from Flight Joysticks connected to the Driver Station.
This class handles standard input that comes from the Driver Station. Each time a value is requested the most recent value is returned. There is a single class instance for each joystick and the mapping of ports to hardware buttons depends on the code in the Driver Station.
Definition at line 19 of file Joystick.java.
| org.wpilib.driverstation.Joystick.Joystick | ( | final int | port | ) |
Construct an instance of a joystick.
| port | The port index on the Driver Station that the joystick is plugged into. |
Definition at line 90 of file Joystick.java.
| org.wpilib.driverstation.Joystick.Joystick | ( | final GenericHID | hid | ) |
Construct an instance of a joystick with a GenericHID object.
| hid | The GenericHID object to use for this joystick. |
Definition at line 99 of file Joystick.java.
| double org.wpilib.driverstation.Joystick.getDirectionDegrees | ( | ) |
Get the direction of the vector formed by the joystick and its origin in degrees. 0 is forward and clockwise is positive. (Straight right is 90.)
Definition at line 427 of file Joystick.java.
| double org.wpilib.driverstation.Joystick.getDirectionRadians | ( | ) |
Get the direction of the vector formed by the joystick and its origin in radians. 0 is forward and clockwise is positive. (Straight right is π/2.)
Definition at line 409 of file Joystick.java.
| GenericHID org.wpilib.driverstation.Joystick.getHID | ( | ) |
Get the underlying GenericHID object.
Implements org.wpilib.driverstation.HIDDevice.
Definition at line 81 of file Joystick.java.
| double org.wpilib.driverstation.Joystick.getMagnitude | ( | ) |
Get the magnitude of the vector formed by the joystick's current position relative to its origin.
Definition at line 399 of file Joystick.java.
| POVDirection org.wpilib.driverstation.Joystick.getPOV | ( | ) |
Get the angle in degrees of the default POV on the HID.
The POV angles start at 0 in the up direction, and increase clockwise (e.g. right is 90, upper-left is 315).
Definition at line 264 of file Joystick.java.
| POVDirection org.wpilib.driverstation.Joystick.getPOV | ( | int | pov | ) |
Get the angle in degrees of a POV on the HID.
The POV angles start at 0 in the up direction, and increase clockwise (e.g. right is 90, upper-left is 315).
| pov | The index of the POV to read, starting at 0. |
Definition at line 252 of file Joystick.java.
| double org.wpilib.driverstation.Joystick.getRawAxis | ( | int | axis | ) |
Get the value of the axis.
| axis | The axis to read, starting at 0. |
Definition at line 239 of file Joystick.java.
| boolean org.wpilib.driverstation.Joystick.getRawButton | ( | int | button | ) |
Get the button value (starting at button 1).
The buttons are returned in a single 16 bit value with one bit representing the state of each button. The appropriate button is returned as a boolean value.
| button | The button number to be read (starting at 1) |
Definition at line 209 of file Joystick.java.
| boolean org.wpilib.driverstation.Joystick.getRawButtonPressed | ( | int | button | ) |
Whether the button was pressed since the last check. Button indexes begin at 1.
| button | The button index, beginning at 1. |
Definition at line 219 of file Joystick.java.
| boolean org.wpilib.driverstation.Joystick.getRawButtonReleased | ( | int | button | ) |
Whether the button was released since the last check. Button indexes begin at 1.
| button | The button index, beginning at 1. |
Definition at line 229 of file Joystick.java.
| final double org.wpilib.driverstation.Joystick.getThrottle | ( | ) |
Get the throttle value of the current joystick. This depends on the mapping of the joystick connected to the current port.
Definition at line 313 of file Joystick.java.
| int org.wpilib.driverstation.Joystick.getThrottleChannel | ( | ) |
Get the channel currently associated with the throttle axis.
Definition at line 196 of file Joystick.java.
| boolean org.wpilib.driverstation.Joystick.getTop | ( | ) |
Read the state of the top button on the joystick.
Definition at line 360 of file Joystick.java.
| boolean org.wpilib.driverstation.Joystick.getTopPressed | ( | ) |
Whether the top button was pressed since the last check.
Definition at line 369 of file Joystick.java.
| boolean org.wpilib.driverstation.Joystick.getTopReleased | ( | ) |
Whether the top button was released since the last check.
Definition at line 378 of file Joystick.java.
| boolean org.wpilib.driverstation.Joystick.getTrigger | ( | ) |
Read the state of the trigger on the joystick.
Definition at line 322 of file Joystick.java.
| boolean org.wpilib.driverstation.Joystick.getTriggerPressed | ( | ) |
Whether the trigger was pressed since the last check.
Definition at line 331 of file Joystick.java.
| boolean org.wpilib.driverstation.Joystick.getTriggerReleased | ( | ) |
Whether the trigger was released since the last check.
Definition at line 340 of file Joystick.java.
| final double org.wpilib.driverstation.Joystick.getTwist | ( | ) |
Get the twist value of the current joystick. This depends on the mapping of the joystick connected to the current port.
Definition at line 303 of file Joystick.java.
| int org.wpilib.driverstation.Joystick.getTwistChannel | ( | ) |
Get the channel currently associated with the twist axis.
Definition at line 187 of file Joystick.java.
| final double org.wpilib.driverstation.Joystick.getX | ( | ) |
Get the X value of the joystick. This depends on the mapping of the joystick connected to the current port. On most joysticks, positive is to the right.
Definition at line 274 of file Joystick.java.
| int org.wpilib.driverstation.Joystick.getXChannel | ( | ) |
Get the channel currently associated with the X axis.
Definition at line 160 of file Joystick.java.
| final double org.wpilib.driverstation.Joystick.getY | ( | ) |
Get the Y value of the joystick. This depends on the mapping of the joystick connected to the current port. On most joysticks, positive is to the back.
Definition at line 284 of file Joystick.java.
| int org.wpilib.driverstation.Joystick.getYChannel | ( | ) |
Get the channel currently associated with the Y axis.
Definition at line 169 of file Joystick.java.
| final double org.wpilib.driverstation.Joystick.getZ | ( | ) |
| int org.wpilib.driverstation.Joystick.getZChannel | ( | ) |
Get the channel currently associated with the Z axis.
Definition at line 178 of file Joystick.java.
| void org.wpilib.driverstation.Joystick.setThrottleChannel | ( | int | channel | ) |
Set the channel associated with the throttle axis.
| channel | The channel to set the axis to. |
Definition at line 142 of file Joystick.java.
| void org.wpilib.driverstation.Joystick.setTwistChannel | ( | int | channel | ) |
Set the channel associated with the twist axis.
| channel | The channel to set the axis to. |
Definition at line 151 of file Joystick.java.
| void org.wpilib.driverstation.Joystick.setXChannel | ( | int | channel | ) |
Set the channel associated with the X axis.
| channel | The channel to set the axis to. |
Definition at line 115 of file Joystick.java.
| void org.wpilib.driverstation.Joystick.setYChannel | ( | int | channel | ) |
Set the channel associated with the Y axis.
| channel | The channel to set the axis to. |
Definition at line 124 of file Joystick.java.
| void org.wpilib.driverstation.Joystick.setZChannel | ( | int | channel | ) |
Set the channel associated with the Z axis.
| channel | The channel to set the axis to. |
Definition at line 133 of file Joystick.java.
| BooleanEvent org.wpilib.driverstation.Joystick.top | ( | EventLoop | loop | ) |
Constructs an event instance around the top button's digital signal.
| loop | the event loop instance to attach the event to. |
Definition at line 389 of file Joystick.java.
| BooleanEvent org.wpilib.driverstation.Joystick.trigger | ( | EventLoop | loop | ) |
Constructs an event instance around the trigger button's digital signal.
| loop | the event loop instance to attach the event to. |
Definition at line 351 of file Joystick.java.
|
static |
Default throttle axis channel.
Definition at line 33 of file Joystick.java.
|
static |
Default twist axis channel.
Definition at line 30 of file Joystick.java.
|
static |
Default X axis channel.
Definition at line 21 of file Joystick.java.
|
static |
Default Y axis channel.
Definition at line 24 of file Joystick.java.
|
static |
Default Z axis channel.
Definition at line 27 of file Joystick.java.