A version of Joystick with Trigger factories for command-based.
- See also
- Joystick
◆ CommandJoystick()
| edu.wpi.first.wpilibj2.command.button.CommandJoystick.CommandJoystick |
( |
int | port | ) |
|
Construct an instance of a controller.
- Parameters
-
| port | The port index on the Driver Station that the controller is plugged into. |
◆ getDirectionDegrees()
| double edu.wpi.first.wpilibj2.command.button.CommandJoystick.getDirectionDegrees |
( |
| ) |
|
Get the direction of the vector formed by the joystick and its origin in degrees.
- Returns
- The direction of the vector in degrees
◆ getDirectionRadians()
| double edu.wpi.first.wpilibj2.command.button.CommandJoystick.getDirectionRadians |
( |
| ) |
|
Get the direction of the vector formed by the joystick and its origin in radians.
- Returns
- The direction of the vector in radians
◆ getHID()
| Joystick edu.wpi.first.wpilibj2.command.button.CommandJoystick.getHID |
( |
| ) |
|
◆ getMagnitude()
| double edu.wpi.first.wpilibj2.command.button.CommandJoystick.getMagnitude |
( |
| ) |
|
Get the magnitude of the direction vector formed by the joystick's current position relative to its origin.
- Returns
- The magnitude of the direction vector
◆ getThrottle()
| double edu.wpi.first.wpilibj2.command.button.CommandJoystick.getThrottle |
( |
| ) |
|
Get the throttle value of the current joystick. This depends on the mapping of the joystick connected to the current port.
- Returns
- The Throttle value of the joystick.
◆ getThrottleChannel()
| int edu.wpi.first.wpilibj2.command.button.CommandJoystick.getThrottleChannel |
( |
| ) |
|
Get the channel currently associated with the throttle axis.
- Returns
- The channel for the axis.
◆ getTwist()
| double edu.wpi.first.wpilibj2.command.button.CommandJoystick.getTwist |
( |
| ) |
|
Get the twist value of the current joystick. This depends on the mapping of the joystick connected to the current port.
- Returns
- The Twist value of the joystick.
◆ getTwistChannel()
| int edu.wpi.first.wpilibj2.command.button.CommandJoystick.getTwistChannel |
( |
| ) |
|
Get the channel currently associated with the twist axis.
- Returns
- The channel for the axis.
◆ getX()
| double edu.wpi.first.wpilibj2.command.button.CommandJoystick.getX |
( |
| ) |
|
Get the x position of the HID.
- Returns
- the x position
◆ getXChannel()
| int edu.wpi.first.wpilibj2.command.button.CommandJoystick.getXChannel |
( |
| ) |
|
Get the channel currently associated with the X axis.
- Returns
- The channel for the axis.
◆ getY()
| double edu.wpi.first.wpilibj2.command.button.CommandJoystick.getY |
( |
| ) |
|
Get the y position of the HID.
- Returns
- the y position
◆ getYChannel()
| int edu.wpi.first.wpilibj2.command.button.CommandJoystick.getYChannel |
( |
| ) |
|
Get the channel currently associated with the Y axis.
- Returns
- The channel for the axis.
◆ getZ()
| double edu.wpi.first.wpilibj2.command.button.CommandJoystick.getZ |
( |
| ) |
|
Get the z position of the HID.
- Returns
- the z position
◆ getZChannel()
| int edu.wpi.first.wpilibj2.command.button.CommandJoystick.getZChannel |
( |
| ) |
|
Get the channel currently associated with the Z axis.
- Returns
- The channel for the axis.
◆ setThrottleChannel()
| void edu.wpi.first.wpilibj2.command.button.CommandJoystick.setThrottleChannel |
( |
int | channel | ) |
|
Set the channel associated with the throttle axis.
- Parameters
-
| channel | The channel to set the axis to. |
◆ setTwistChannel()
| void edu.wpi.first.wpilibj2.command.button.CommandJoystick.setTwistChannel |
( |
int | channel | ) |
|
Set the channel associated with the twist axis.
- Parameters
-
| channel | The channel to set the axis to. |
◆ setXChannel()
| void edu.wpi.first.wpilibj2.command.button.CommandJoystick.setXChannel |
( |
int | channel | ) |
|
Set the channel associated with the X axis.
- Parameters
-
| channel | The channel to set the axis to. |
◆ setYChannel()
| void edu.wpi.first.wpilibj2.command.button.CommandJoystick.setYChannel |
( |
int | channel | ) |
|
Set the channel associated with the Y axis.
- Parameters
-
| channel | The channel to set the axis to. |
◆ setZChannel()
| void edu.wpi.first.wpilibj2.command.button.CommandJoystick.setZChannel |
( |
int | channel | ) |
|
Set the channel associated with the Z axis.
- Parameters
-
| channel | The channel to set the axis to. |
◆ top() [1/2]
| Trigger edu.wpi.first.wpilibj2.command.button.CommandJoystick.top |
( |
| ) |
|
◆ top() [2/2]
| Trigger edu.wpi.first.wpilibj2.command.button.CommandJoystick.top |
( |
EventLoop | loop | ) |
|
Constructs an event instance around the top button's digital signal.
- Parameters
-
| loop | the event loop instance to attach the event to. |
- Returns
- an event instance representing the top button's digital signal attached to the given loop.
◆ trigger() [1/2]
| Trigger edu.wpi.first.wpilibj2.command.button.CommandJoystick.trigger |
( |
| ) |
|
◆ trigger() [2/2]
| Trigger edu.wpi.first.wpilibj2.command.button.CommandJoystick.trigger |
( |
EventLoop | loop | ) |
|
Constructs an event instance around the trigger button's digital signal.
- Parameters
-
| loop | the event loop instance to attach the event to. |
- Returns
- an event instance representing the trigger button's digital signal attached to the given loop.
The documentation for this class was generated from the following file:
- D:/SDASVN/2025/RaspberryPi/VSCode/Source/edu/wpi/first/wpilibj2/command/button/CommandJoystick.java