Package frc.spectrumLib.gamepads
Class Gamepad.Config
java.lang.Object
frc.spectrumLib.gamepads.Gamepad.Config
- Direct Known Subclasses:
Operator.OperatorConfig,Pilot.PilotConfig
- Enclosing class:
- Gamepad
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 -
Method Summary
Modifier and TypeMethodDescriptiondoubleDeadzone applied to both left-stick axes before the exponential curve.doubleExponent for the left-stick exponential response curve (1.0 = linear).doubleOutput scalar applied after the left-stick exponential curve.getName()Human-readable controller name used in alerts and telemetry.intgetPort()USB port number as shown in the DriverStation application (0-indexed).doubleDeadzone applied to both right-stick axes before the exponential curve.doubleExponent for the right-stick exponential response curve.doubleOutput scalar applied after the right-stick exponential curve.doubleDeadzone applied to both analog trigger axes before the exponential curve.doubleExponent for the analog-trigger exponential response curve.doubleOutput scalar applied after the analog-trigger exponential curve.booleanWhether this controller should be used on the current robot;falsedisables it.voidsetAttached(boolean attached) Whether this controller should be used on the current robot;falsedisables it.voidsetLeftStickDeadzone(double leftStickDeadzone) Deadzone applied to both left-stick axes before the exponential curve.voidsetLeftStickExp(double leftStickExp) Exponent for the left-stick exponential response curve (1.0 = linear).voidsetLeftStickScalar(double leftStickScalar) Output scalar applied after the left-stick exponential curve.voidsetRightStickDeadzone(double rightStickDeadzone) Deadzone applied to both right-stick axes before the exponential curve.voidsetRightStickExp(double rightStickExp) Exponent for the right-stick exponential response curve.voidsetRightStickScalar(double rightStickScalar) Output scalar applied after the right-stick exponential curve.voidsetTriggersDeadzone(double triggersDeadzone) Deadzone applied to both analog trigger axes before the exponential curve.voidsetTriggersExp(double triggersExp) Exponent for the analog-trigger exponential response curve.voidsetTriggersScalar(double triggersScalar) Output scalar applied after the analog-trigger exponential curve.
-
Constructor Details
-
Config
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
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;falsedisables it. -
setAttached
public void setAttached(boolean attached) Whether this controller should be used on the current robot;falsedisables 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.
-