Package org.bobabots253.Tapioca
Class XboxController
- java.lang.Object
-
- edu.wpi.first.wpilibj.GenericHID
-
- edu.wpi.first.wpilibj.XboxController
-
- org.bobabots253.Tapioca.XboxController
-
public class XboxController extends XboxController
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classXboxController.DeadbandAxis-
Nested classes/interfaces inherited from class edu.wpi.first.wpilibj.XboxController
XboxController.Axis, XboxController.Button
-
Nested classes/interfaces inherited from class edu.wpi.first.wpilibj.GenericHID
GenericHID.Hand, GenericHID.HIDType, GenericHID.RumbleType
-
-
Constructor Summary
Constructors Constructor Description XboxController(int port)Construct an instance of a joystick.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JoystickButtongetButton(XboxController.Button button)Get the virtualJoystickButtonthat corresponds to the physical button on the Xbox controller.POVButtongetButton(CompassPOV direction)Get the virtualPOVButtonthat corresponds to the physical button on the Xbox controller.DeadbandgetDeadband(XboxController.DeadbandAxis axis)Get the deadband for this object.doublegetTriggerAxis(GenericHID.Hand hand)Get the trigger axis value of the controller, with deadband applied.doublegetTriggerAxis(GenericHID.Hand hand, boolean deadbanded)Get the trigger axis value of the controller.doublegetX(GenericHID.Hand hand)Get the X axis value of the controller, with deadband applied.doublegetX(GenericHID.Hand hand, boolean deadbanded)Get the X axis value of the controller.doublegetY(GenericHID.Hand hand)Get the Y axis value of the controller, with deadband applied.doublegetY(GenericHID.Hand hand, boolean deadbanded)Get the Y axis value of the controller.voidsetDeadband(Deadband deadband, XboxController.DeadbandAxis axis)Sets the deadband for this object.-
Methods inherited from class edu.wpi.first.wpilibj.XboxController
getAButton, getAButtonPressed, getAButtonReleased, getBackButton, getBackButtonPressed, getBackButtonReleased, getBButton, getBButtonPressed, getBButtonReleased, getBumper, getBumperPressed, getBumperReleased, getStartButton, getStartButtonPressed, getStartButtonReleased, getStickButton, getStickButtonPressed, getStickButtonReleased, getXButton, getXButtonPressed, getXButtonReleased, getYButton, getYButtonPressed, getYButtonReleased
-
Methods inherited from class edu.wpi.first.wpilibj.GenericHID
getAxisCount, getAxisType, getButtonCount, getName, getPort, getPOV, getPOV, getPOVCount, getRawAxis, getRawButton, getRawButtonPressed, getRawButtonReleased, getType, getX, getY, isConnected, setOutput, setOutputs, setRumble
-
-
-
-
Method Detail
-
getButton
public JoystickButton getButton(XboxController.Button button)
Get the virtualJoystickButtonthat corresponds to the physical button on the Xbox controller.- Parameters:
button- TheXboxController.Buttonto get.- Returns:
- A new
JoystickButtonobject.
-
getButton
public POVButton getButton(CompassPOV direction)
Get the virtualPOVButtonthat corresponds to the physical button on the Xbox controller.
-
setDeadband
public void setDeadband(Deadband deadband, XboxController.DeadbandAxis axis)
Sets the deadband for this object.- Parameters:
deadband- The deadband to setaxis- The axis to deadband
-
getDeadband
public Deadband getDeadband(XboxController.DeadbandAxis axis)
Get the deadband for this object.- Parameters:
axis- The deadbanded axis.- Returns:
- The deadband object for the deadbanded axis.
-
getTriggerAxis
public double getTriggerAxis(GenericHID.Hand hand, boolean deadbanded)
Get the trigger axis value of the controller.- Parameters:
hand- Side of controller whose value should be returned.deadbanded- Whether or not to apply deadband to the returned value.- Returns:
- The trigger axis value of the controller.
-
getTriggerAxis
public double getTriggerAxis(GenericHID.Hand hand)
Get the trigger axis value of the controller, with deadband applied.- Overrides:
getTriggerAxisin classXboxController- Parameters:
hand- Side of controller whose value should be returned.- Returns:
- The trigger axis value of the controller.
-
getX
public double getX(GenericHID.Hand hand, boolean deadbanded)
Get the X axis value of the controller.- Parameters:
hand- Side of controller whose value should be returned.deadbanded- Whether or not to apply deadband to the returned value.- Returns:
- The X axis value of the controller.
-
getX
public double getX(GenericHID.Hand hand)
Get the X axis value of the controller, with deadband applied.- Overrides:
getXin classXboxController- Parameters:
hand- Side of controller whose value should be returned.- Returns:
- The X axis value of the controller.
-
getY
public double getY(GenericHID.Hand hand, boolean deadbanded)
Get the Y axis value of the controller.- Parameters:
hand- Side of controller whose value should be returned.deadbanded- Whether or not to apply deadband to the returned value.- Returns:
- The Y axis value of the controller.
-
getY
public double getY(GenericHID.Hand hand)
Get the Y axis value of the controller, with deadband applied.- Overrides:
getYin classXboxController- Parameters:
hand- Side of controller whose value should be returned.- Returns:
- The Y axis value of the controller.
-
-