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
    Modifier and Type
    Field
    Description
    protected final double
     
    final edu.wpi.first.wpilibj.event.EventLoop
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    CustomCommandPS4(int port, double deadzone)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    edu.wpi.first.wpilibj2.command.button.Trigger
    button(int button)
     
    edu.wpi.first.wpilibj2.command.button.Trigger
    button(int button, edu.wpi.first.wpilibj.event.EventLoop _loop)
    Deprecated.
    void
     
    protected double
    deadzone(double input)
     
    double
    Get the X axis value of left side of the controller.
    double
    Get the Y axis value of left side of the controller.
    double
    Get the X axis value of right side of the controller.
    double
    Get the Y axis value of right side of the controller.
    edu.wpi.first.wpilibj2.command.button.Trigger
    pov(int pov, int angle)
     
    edu.wpi.first.wpilibj2.command.button.Trigger
    pov(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, triangle

    Methods 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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:
      button in class edu.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, use button(int) instead.
      Overrides:
      button in class edu.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 like CommandGenericHID.pov(int), pov(int, int), or CommandGenericHID.povUp().
      Overrides:
      pov in class edu.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.
      Overrides:
      getLeftX in class edu.wpi.first.wpilibj2.command.button.CommandPS4Controller
    • getLeftY

      public double getLeftY()
      Get the Y axis value of left side of the controller.
      Overrides:
      getLeftY in class edu.wpi.first.wpilibj2.command.button.CommandPS4Controller
    • getRightX

      public double getRightX()
      Get the X axis value of right side of the controller.
      Overrides:
      getRightX in class edu.wpi.first.wpilibj2.command.button.CommandPS4Controller
    • getRightY

      public double getRightY()
      Get the Y axis value of right side of the controller.
      Overrides:
      getRightY in class edu.wpi.first.wpilibj2.command.button.CommandPS4Controller
    • deadzone

      protected double deadzone(double input)