Class CustomCommandJoystick

java.lang.Object
edu.wpi.first.wpilibj2.command.button.CommandGenericHID
edu.wpi.first.wpilibj2.command.button.CommandJoystick
lib.custom.controllers.CustomCommandJoystick

public class CustomCommandJoystick extends edu.wpi.first.wpilibj2.command.button.CommandJoystick
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.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final edu.wpi.first.wpilibj2.command.button.Trigger
     
    final edu.wpi.first.wpilibj2.command.button.Trigger
     
    final edu.wpi.first.wpilibj2.command.button.Trigger
     
    final edu.wpi.first.wpilibj2.command.button.Trigger
     
    final edu.wpi.first.wpilibj2.command.button.Trigger
     
    final edu.wpi.first.wpilibj2.command.button.Trigger
     
    final edu.wpi.first.wpilibj2.command.button.Trigger
     
    final edu.wpi.first.wpilibj2.command.button.Trigger
     
    final edu.wpi.first.wpilibj2.command.button.Trigger
     
    final edu.wpi.first.wpilibj2.command.button.Trigger
     
    final edu.wpi.first.wpilibj2.command.button.Trigger
     
    final edu.wpi.first.wpilibj2.command.button.Trigger
     
    protected final double
     
    final edu.wpi.first.wpilibj.event.EventLoop
     
    protected final int
     
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    boolean
    Returns true if a given axis is above the move threshold.
    edu.wpi.first.wpilibj2.command.button.Trigger
    button(int id)
     
    edu.wpi.first.wpilibj2.command.button.Trigger
    button(int button, edu.wpi.first.wpilibj.event.EventLoop loop)
     
    void
     
    boolean
    Returns true if the joystick is actually connected.
    double
    Returns the value of the given axis, with the deadzone applied.
    double
    Returns the raw value of the given axis (no deadzone calculation).

    Methods inherited from class edu.wpi.first.wpilibj2.command.button.CommandJoystick

    getDirectionDegrees, getDirectionRadians, getHID, getMagnitude, getThrottle, getThrottleChannel, getTwist, getTwistChannel, getX, getXChannel, getY, getYChannel, getZ, getZChannel, setThrottleChannel, setTwistChannel, setXChannel, setYChannel, setZChannel, top, top, trigger, trigger

    Methods inherited from class edu.wpi.first.wpilibj2.command.button.CommandGenericHID

    axisGreaterThan, axisGreaterThan, axisLessThan, axisLessThan, axisMagnitudeGreaterThan, axisMagnitudeGreaterThan, getRawAxis, isConnected, pov, 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
    • port

      protected final int port
    • button1

      public final edu.wpi.first.wpilibj2.command.button.Trigger button1
    • button2

      public final edu.wpi.first.wpilibj2.command.button.Trigger button2
    • button3

      public final edu.wpi.first.wpilibj2.command.button.Trigger button3
    • button4

      public final edu.wpi.first.wpilibj2.command.button.Trigger button4
    • button5

      public final edu.wpi.first.wpilibj2.command.button.Trigger button5
    • button6

      public final edu.wpi.first.wpilibj2.command.button.Trigger button6
    • button7

      public final edu.wpi.first.wpilibj2.command.button.Trigger button7
    • button8

      public final edu.wpi.first.wpilibj2.command.button.Trigger button8
    • button9

      public final edu.wpi.first.wpilibj2.command.button.Trigger button9
    • button10

      public final edu.wpi.first.wpilibj2.command.button.Trigger button10
    • button11

      public final edu.wpi.first.wpilibj2.command.button.Trigger button11
    • button12

      public final edu.wpi.first.wpilibj2.command.button.Trigger button12
  • Constructor Details

    • CustomCommandJoystick

      public CustomCommandJoystick(int port, double deadzone)
  • Method Details

    • button

      public edu.wpi.first.wpilibj2.command.button.Trigger button(int id)
      Overrides:
      button in class edu.wpi.first.wpilibj2.command.button.CommandGenericHID
    • button

      public edu.wpi.first.wpilibj2.command.button.Trigger button(int button, edu.wpi.first.wpilibj.event.EventLoop loop)
      Overrides:
      button in class edu.wpi.first.wpilibj2.command.button.CommandGenericHID
    • clearBindings

      public void clearBindings()
    • connected

      public boolean connected()
      Returns true if the joystick is actually connected. It determines this by counting the number of buttons (more than 0 means the joystick is connected).
    • getRawAxis

      public double getRawAxis(CustomCommandJoystick.Axis axis)
      Returns the raw value of the given axis (no deadzone calculation).
    • getAxis

      public double getAxis(CustomCommandJoystick.Axis axis)
      Returns the value of the given axis, with the deadzone applied.
    • active

      public boolean active(CustomCommandJoystick.Axis axis)
      Returns true if a given axis is above the move threshold.
      Returns:
      whether the current value of that axis is outside the deadzone