Package lib.custom.controllers
Class CustomCommandPS4
java.lang.Object
edu.wpi.first.wpilibj2.command.button.CommandGenericHID
edu.wpi.first.wpilibj2.command.button.CommandPS4Controller
lib.custom.controllers.CustomCommandPS4
public class CustomCommandPS4
extends edu.wpi.first.wpilibj2.command.button.CommandPS4Controller
A joystick that implements the generic controller interface and the 2023
trigger interface. This allows us to use a joystick as a controller. This
contains 12 buttons to reflect the joysticks we are typically using.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionedu.wpi.first.wpilibj2.command.button.Triggerbutton(int button) edu.wpi.first.wpilibj2.command.button.Triggerbutton(int button, edu.wpi.first.wpilibj.event.EventLoop _loop) Deprecated.voidprotected doubledeadzone(double input) doublegetLeftX()Get the X axis value of left side of the controller with deadzone applied.doublegetLeftY()Get the Y axis value of left side of the controller with deadzone applied.doubleGet the raw X axis value of left side of the controller.doubleGet the raw Y axis value of left side of the controller.doubleGet the raw X axis value of right side of the controller.doubleGet the raw Y axis value of right side of the controller.doubleGet the X axis value of right side of the controller with deadzone applied.doubleGet the Y axis value of right side of the controller with deadzone applied.edu.wpi.first.wpilibj2.command.button.Triggerpov(int pov, int angle) edu.wpi.first.wpilibj2.command.button.Triggerpov(int pov, int angle, edu.wpi.first.wpilibj.event.EventLoop _loop) Deprecated.Methods inherited from class edu.wpi.first.wpilibj2.command.button.CommandPS4Controller
circle, circle, cross, cross, getHID, getL2Axis, getR2Axis, L1, L1, L2, L2, L3, L3, options, options, PS, PS, R1, R1, R2, R2, R3, R3, share, share, square, square, touchpad, touchpad, triangle, triangleMethods inherited from class edu.wpi.first.wpilibj2.command.button.CommandGenericHID
axisGreaterThan, axisGreaterThan, axisLessThan, axisLessThan, axisMagnitudeGreaterThan, axisMagnitudeGreaterThan, getRawAxis, isConnected, pov, povCenter, povDown, povDownLeft, povDownRight, povLeft, povRight, povUp, povUpLeft, povUpRight, setRumble
-
Field Details
-
loop
public final edu.wpi.first.wpilibj.event.EventLoop loop -
deadzone
protected final double deadzone
-
-
Constructor Details
-
CustomCommandPS4
public CustomCommandPS4(int port, double deadzone)
-
-
Method Details
-
button
public edu.wpi.first.wpilibj2.command.button.Trigger button(int button) - Overrides:
buttonin classedu.wpi.first.wpilibj2.command.button.CommandGenericHID
-
button
@Deprecated public edu.wpi.first.wpilibj2.command.button.Trigger button(int button, edu.wpi.first.wpilibj.event.EventLoop _loop) Deprecated.Not actually "deprecated"; do not remove. Should not be used in our code, usebutton(int)instead.- Overrides:
buttonin classedu.wpi.first.wpilibj2.command.button.CommandGenericHID
-
pov
public edu.wpi.first.wpilibj2.command.button.Trigger pov(int pov, int angle) -
pov
@Deprecated public edu.wpi.first.wpilibj2.command.button.Trigger pov(int pov, int angle, edu.wpi.first.wpilibj.event.EventLoop _loop) Deprecated.Not actually "deprecated"; do not remove. Should not be used in our code, use other pov methods instead likeCommandGenericHID.pov(int),pov(int, int), orCommandGenericHID.povUp().- Overrides:
povin classedu.wpi.first.wpilibj2.command.button.CommandGenericHID
-
clearBindings
public void clearBindings() -
getLeftX
public double getLeftX()Get the X axis value of left side of the controller with deadzone applied.- Overrides:
getLeftXin classedu.wpi.first.wpilibj2.command.button.CommandPS4Controller
-
getLeftY
public double getLeftY()Get the Y axis value of left side of the controller with deadzone applied.- Overrides:
getLeftYin classedu.wpi.first.wpilibj2.command.button.CommandPS4Controller
-
getRightX
public double getRightX()Get the X axis value of right side of the controller with deadzone applied.- Overrides:
getRightXin classedu.wpi.first.wpilibj2.command.button.CommandPS4Controller
-
getRightY
public double getRightY()Get the Y axis value of right side of the controller with deadzone applied.- Overrides:
getRightYin classedu.wpi.first.wpilibj2.command.button.CommandPS4Controller
-
getRawLeftX
public double getRawLeftX()Get the raw X axis value of left side of the controller. -
getRawLeftY
public double getRawLeftY()Get the raw Y axis value of left side of the controller. -
getRawRightX
public double getRawRightX()Get the raw X axis value of right side of the controller. -
getRawRightY
public double getRawRightY()Get the raw Y axis value of right side of the controller. -
deadzone
protected double deadzone(double input)
-