Class Gamepad.Config

java.lang.Object
frc.spectrumLib.gamepads.Gamepad.Config
Direct Known Subclasses:
Operator.OperatorConfig, Pilot.PilotConfig
Enclosing class:
Gamepad

public static class Gamepad.Config extends Object
Configuration for a Gamepad instance, defining the DriverStation USB port, axis curve parameters, and whether the controller should be used on this robot.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Config(String name, int port)
    Creates a gamepad configuration for the given port.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Deadzone applied to both left-stick axes before the exponential curve.
    double
    Exponent for the left-stick exponential response curve (1.0 = linear).
    double
    Output scalar applied after the left-stick exponential curve.
    Human-readable controller name used in alerts and telemetry.
    int
    USB port number as shown in the DriverStation application (0-indexed).
    double
    Deadzone applied to both right-stick axes before the exponential curve.
    double
    Exponent for the right-stick exponential response curve.
    double
    Output scalar applied after the right-stick exponential curve.
    double
    Deadzone applied to both analog trigger axes before the exponential curve.
    double
    Exponent for the analog-trigger exponential response curve.
    double
    Output scalar applied after the analog-trigger exponential curve.
    boolean
    Whether this controller should be used on the current robot; false disables it.
    void
    setAttached(boolean attached)
    Whether this controller should be used on the current robot; false disables it.
    void
    setLeftStickDeadzone(double leftStickDeadzone)
    Deadzone applied to both left-stick axes before the exponential curve.
    void
    setLeftStickExp(double leftStickExp)
    Exponent for the left-stick exponential response curve (1.0 = linear).
    void
    setLeftStickScalar(double leftStickScalar)
    Output scalar applied after the left-stick exponential curve.
    void
    setRightStickDeadzone(double rightStickDeadzone)
    Deadzone applied to both right-stick axes before the exponential curve.
    void
    setRightStickExp(double rightStickExp)
    Exponent for the right-stick exponential response curve.
    void
    setRightStickScalar(double rightStickScalar)
    Output scalar applied after the right-stick exponential curve.
    void
    setTriggersDeadzone(double triggersDeadzone)
    Deadzone applied to both analog trigger axes before the exponential curve.
    void
    setTriggersExp(double triggersExp)
    Exponent for the analog-trigger exponential response curve.
    void
    setTriggersScalar(double triggersScalar)
    Output scalar applied after the analog-trigger exponential curve.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Config

      public Config(String name, int port)
      Creates a gamepad configuration for the given port.
      Parameters:
      name - human-readable controller name (used in alerts)
      port - DriverStation USB port number (0-indexed)
  • Method Details

    • getName

      public String getName()
      Human-readable controller name used in alerts and telemetry.
    • getPort

      public int getPort()
      USB port number as shown in the DriverStation application (0-indexed).
    • isAttached

      public boolean isAttached()
      Whether this controller should be used on the current robot; false disables it.
    • setAttached

      public void setAttached(boolean attached)
      Whether this controller should be used on the current robot; false disables it.
    • getLeftStickDeadzone

      public double getLeftStickDeadzone()
      Deadzone applied to both left-stick axes before the exponential curve.
    • setLeftStickDeadzone

      public void setLeftStickDeadzone(double leftStickDeadzone)
      Deadzone applied to both left-stick axes before the exponential curve.
    • getLeftStickExp

      public double getLeftStickExp()
      Exponent for the left-stick exponential response curve (1.0 = linear).
    • setLeftStickExp

      public void setLeftStickExp(double leftStickExp)
      Exponent for the left-stick exponential response curve (1.0 = linear).
    • getLeftStickScalar

      public double getLeftStickScalar()
      Output scalar applied after the left-stick exponential curve.
    • setLeftStickScalar

      public void setLeftStickScalar(double leftStickScalar)
      Output scalar applied after the left-stick exponential curve.
    • getRightStickDeadzone

      public double getRightStickDeadzone()
      Deadzone applied to both right-stick axes before the exponential curve.
    • setRightStickDeadzone

      public void setRightStickDeadzone(double rightStickDeadzone)
      Deadzone applied to both right-stick axes before the exponential curve.
    • getRightStickExp

      public double getRightStickExp()
      Exponent for the right-stick exponential response curve.
    • setRightStickExp

      public void setRightStickExp(double rightStickExp)
      Exponent for the right-stick exponential response curve.
    • getRightStickScalar

      public double getRightStickScalar()
      Output scalar applied after the right-stick exponential curve.
    • setRightStickScalar

      public void setRightStickScalar(double rightStickScalar)
      Output scalar applied after the right-stick exponential curve.
    • getTriggersDeadzone

      public double getTriggersDeadzone()
      Deadzone applied to both analog trigger axes before the exponential curve.
    • setTriggersDeadzone

      public void setTriggersDeadzone(double triggersDeadzone)
      Deadzone applied to both analog trigger axes before the exponential curve.
    • getTriggersExp

      public double getTriggersExp()
      Exponent for the analog-trigger exponential response curve.
    • setTriggersExp

      public void setTriggersExp(double triggersExp)
      Exponent for the analog-trigger exponential response curve.
    • getTriggersScalar

      public double getTriggersScalar()
      Output scalar applied after the analog-trigger exponential curve.
    • setTriggersScalar

      public void setTriggersScalar(double triggersScalar)
      Output scalar applied after the analog-trigger exponential curve.