Package org.chsrobotics.lib.input
Class XboxController
- java.lang.Object
-
- org.chsrobotics.lib.input.XboxController
-
public class XboxController extends java.lang.ObjectWrapper class for the Xbox controller used by FRC 997.
-
-
Constructor Summary
Constructors Constructor Description XboxController(int port)Constructs an XboxController connected to a specific port in the driver station application.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JoystickButtonAButton()Returns the JoystickButton cooresponding to the A button.JoystickButtonbackButton()Returns the JoystickButton cooresponding to the back button on the controller.JoystickButtonBButton()Returns the JoystickButton cooresponding to the B button.doublegetLeftRumble()Returns the currently applied left-side rumble value.doublegetRightRumble()Returns the currently applied right-side rumble value.JoystickButtonleftBumperButton()Returns the JoystickButton cooresponding to the left bumper.JoystickButtonleftStickButton()Returns the JoystickButton cooresponding to the left stick button (pushing the stick into the controller, should make a small click).JoystickAxisleftStickHorizontalAxis()Returns the JoystickAxis cooresponding to the left stick's horizontal axis.JoystickAxisleftStickVerticalAxis()Returns the JoystickAxis cooresponding to the left stick's vertical axis.JoystickAxisleftTriggerAxis()Returns the JoystickAxis cooresponding to the left trigger.JoystickButtonrightBumperButton()Returns the JoystickButton cooresponding to the right bumper.JoystickButtonrightStickButton()Returns the JoystickButton cooresponding to the right stick button (pushing the stick into the controller, should make a small click).JoystickAxisrightStickHorizontalAxis()Returns the JoystickAxis cooresponding to the right stick's horizontal axis.JoystickAxisrightStickVerticalAxis()Returns the JoystickAxis cooresponding to the right stick's vertical axis.JoystickAxisrightTriggerAxis()Returns the JoystickAxis cooresponding to the right trigger.voidsetLeftRumble(double value)Sets the rumble of the left side of the controller, for driver feedback.voidsetRightRumble(double value)Sets the rumble of the right side of the controller, for driver feedback.JoystickButtonstartButton()Returns the JoystickButton cooresponding to the start button on the controller.JoystickButtonXButton()Returns the JoystickButton cooresponding to the X button.JoystickButtonYButton()Returns the JoystickButton cooresponding to the Y button.
-
-
-
Method Detail
-
setRightRumble
public void setRightRumble(double value)
Sets the rumble of the right side of the controller, for driver feedback.- Parameters:
value- The rumble value in [0,1] (inclusive).
-
setLeftRumble
public void setLeftRumble(double value)
Sets the rumble of the left side of the controller, for driver feedback.- Parameters:
value- The rumble value in [0,1] (inclusive).
-
getRightRumble
public double getRightRumble()
Returns the currently applied right-side rumble value.- Returns:
- The current rumble value, in [0,1] (inclusive).
-
getLeftRumble
public double getLeftRumble()
Returns the currently applied left-side rumble value.- Returns:
- The current rumble value, in [0,1] (inclusive).
-
leftStickVerticalAxis
public JoystickAxis leftStickVerticalAxis()
Returns the JoystickAxis cooresponding to the left stick's vertical axis. Throws a warning if already allocated.- Returns:
- The JoystickAxis at index 1.
-
leftStickHorizontalAxis
public JoystickAxis leftStickHorizontalAxis()
Returns the JoystickAxis cooresponding to the left stick's horizontal axis. Throws a warning if already allocated.- Returns:
- The JoystickAxis at index 0.
-
rightStickVerticalAxis
public JoystickAxis rightStickVerticalAxis()
Returns the JoystickAxis cooresponding to the right stick's vertical axis. Throws a warning if already allocated.- Returns:
- The JoystickAxis at index 5.
-
rightStickHorizontalAxis
public JoystickAxis rightStickHorizontalAxis()
Returns the JoystickAxis cooresponding to the right stick's horizontal axis. Throws a warning if already allocated.- Returns:
- The JoystickAxis at index 4.
-
leftTriggerAxis
public JoystickAxis leftTriggerAxis()
Returns the JoystickAxis cooresponding to the left trigger. Throws a warning if already allocated.The triggers don't follow the conventions of the other axis regarding value for the mechanical default position.
- Returns:
- The JoystickAxis at index 2.
-
rightTriggerAxis
public JoystickAxis rightTriggerAxis()
Returns the JoystickAxis cooresponding to the right trigger. Throws a warning if already allocated.The triggers don't follow the conventions of the other axis regarding value for the mechanical default position.
- Returns:
- The JoystickAxis at index 3.
-
AButton
public JoystickButton AButton()
Returns the JoystickButton cooresponding to the A button. Throws a warning if already allocated.- Returns:
- The JoystickButton at index 1.
-
BButton
public JoystickButton BButton()
Returns the JoystickButton cooresponding to the B button. Throws a warning if already allocated.- Returns:
- The JoystickButton at index 2.
-
XButton
public JoystickButton XButton()
Returns the JoystickButton cooresponding to the X button. Throws a warning if already allocated.- Returns:
- The JoystickButton at index 3.
-
YButton
public JoystickButton YButton()
Returns the JoystickButton cooresponding to the Y button. Throws a warning if already allocated.- Returns:
- The JoystickButton at index 4.
-
leftBumperButton
public JoystickButton leftBumperButton()
Returns the JoystickButton cooresponding to the left bumper. Throws a warning if already allocated.- Returns:
- The JoystickButton at index 5.
-
rightBumperButton
public JoystickButton rightBumperButton()
Returns the JoystickButton cooresponding to the right bumper. Throws a warning if already allocated.- Returns:
- The JoystickButton at index 6.
-
leftStickButton
public JoystickButton leftStickButton()
Returns the JoystickButton cooresponding to the left stick button (pushing the stick into the controller, should make a small click). Throws a warning if already allocated.- Returns:
- The JoystickButton at index 9.
-
rightStickButton
public JoystickButton rightStickButton()
Returns the JoystickButton cooresponding to the right stick button (pushing the stick into the controller, should make a small click). Throws a warning if already allocated.- Returns:
- The JoystickButton at index 10.
-
backButton
public JoystickButton backButton()
Returns the JoystickButton cooresponding to the back button on the controller. Throws a warning if already allocated.- Returns:
- The JoystickButton at index 7.
-
startButton
public JoystickButton startButton()
Returns the JoystickButton cooresponding to the start button on the controller. Throws a warning if already allocated.- Returns:
- The JoystickButton at index 8.
-
-