Class TriggerBindingsConfig
The speed scales are absolute fractions of the robot's configured maximum speed. For example, a normal speed scale of 0.8 means the driver can reach 80 percent of the robot's theoretical top speed with the stick at full deflection and no trigger held. This keeps all speed tuning in one place rather than splitting it between the controller config and the drive base config.
-
Nested Class Summary
Nested classes/interfaces inherited from class frc.robot.shared.config.AbstractConfig
AbstractConfig.ComponentPoseConfig -
Field Summary
FieldsModifier and TypeFieldDescriptionDriver controller configuration for d-pad pathfinding targets and constraints.doubleJoystick deadband for driver stick inputs.doubleResponse curve exponent for the left stick X axis (left/right translation).doubleResponse curve exponent for the left stick Y axis (forward/backward translation).doubleFraction of maximum linear speed used during normal driving (no trigger held).doubleResponse curve exponent for the right stick X axis (rotation/omega).doubleFraction of maximum linear speed used when the left trigger (precision/slow) is held.doubleFraction of maximum linear speed used when the right trigger (sprint) is held.doubleMinimum trigger axis value required to consider a trigger "pressed."booleanEnables tuning mode for trigger bindings. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleReads the tunable joystick deadband for driver stick inputs.doubleReads the tunable response curve exponent for the left stick X axis.doubleReads the tunable response curve exponent for the left stick Y axis.doubleReads the tunable normal (no trigger) speed scale.doubleReads the tunable response curve exponent for the right stick X axis.doubleReads the tunable slow (left trigger) speed scale.doubleReads the tunable sprint (right trigger) speed scale.doubleReads the tunable deadband threshold for trigger activation.booleanReads whether tuning mode is enabled for trigger bindings.Methods inherited from class frc.robot.shared.config.AbstractConfig
getDashboardPrefix, initializeNestedDashboardPrefixes, readTunableBoolean, readTunableDegrees, readTunableDegreesAsRadians, readTunableNumber, readTunableString, setDashboardPrefix
-
Field Details
-
leftStickYResponseExponent
public double leftStickYResponseExponentResponse curve exponent for the left stick Y axis (forward/backward translation).Applied before the speed scale so it sets the baseline feel. A value of 2.0 (quadratic) is a good starting point for most drivers: small stick movements give fine control, while full deflection still reaches max speed.
-
leftStickXResponseExponent
public double leftStickXResponseExponentResponse curve exponent for the left stick X axis (left/right translation).Applied before the speed scale so it sets the baseline feel. Typically matches the Y axis exponent for consistent translation response.
-
rightStickXResponseExponent
public double rightStickXResponseExponentResponse curve exponent for the right stick X axis (rotation/omega).Applied independently of the speed scale since rotation is not affected by triggers. A value of 2.0 makes small rotational corrections easier without reducing max turn rate.
-
normalSpeedScale
public double normalSpeedScaleFraction of maximum linear speed used during normal driving (no trigger held).A value of 0.8 means fully deflecting the stick reaches 80 percent of the robot's configured top speed. This is the default "gear" the driver lives in most of the time.
-
sprintSpeedScale
public double sprintSpeedScaleFraction of maximum linear speed used when the right trigger (sprint) is held.A value of 1.0 means fully deflecting the stick reaches 100 percent of the robot's configured top speed. Think of it like a sprint button in a video game.
-
slowSpeedScale
public double slowSpeedScaleFraction of maximum linear speed used when the left trigger (precision/slow) is held.A value of 0.4 means fully deflecting the stick reaches 40 percent of the robot's configured top speed. Useful for precise alignment and slow-speed maneuvering.
-
triggerDeadband
public double triggerDeadbandMinimum trigger axis value required to consider a trigger "pressed."Values below this threshold are ignored to prevent accidental activation from controller noise or resting position drift.
-
joystickDeadband
public double joystickDeadbandJoystick deadband for driver stick inputs.Stick values inside this range are treated as zero to ignore noise when the stick is at rest. A typical value is 0.08 (8 percent of full deflection). Applied before the response curve so that stick noise is eliminated before the power function can amplify it.
-
tuningEnabled
public boolean tuningEnabledEnables tuning mode for trigger bindings.When
true, the driver controller A/B/X buttons are mapped to subsystem test commands (min/max setpoints and SysId sweeps) via a dashboard-selectable subsystem chooser, and default commands are not registered so mechanisms stay where test commands leave them. Whenfalse(the default), production gameplay bindings and operator state-transition buttons are active instead.Because WPILib trigger bindings are wired once at construction, a code restart is required after changing this value.
-
driverControllerConfig
Driver controller configuration for d-pad pathfinding targets and constraints.
-
-
Constructor Details
-
TriggerBindingsConfig
public TriggerBindingsConfig()
-
-
Method Details
-
getLeftStickYResponseExponent
public double getLeftStickYResponseExponent()Reads the tunable response curve exponent for the left stick Y axis.- Returns:
- current left stick Y response exponent (1.0 = linear, 2.0 = quadratic)
-
getLeftStickXResponseExponent
public double getLeftStickXResponseExponent()Reads the tunable response curve exponent for the left stick X axis.- Returns:
- current left stick X response exponent (1.0 = linear, 2.0 = quadratic)
-
getRightStickXResponseExponent
public double getRightStickXResponseExponent()Reads the tunable response curve exponent for the right stick X axis.- Returns:
- current right stick X response exponent (1.0 = linear, 2.0 = quadratic)
-
getNormalSpeedScale
public double getNormalSpeedScale()Reads the tunable normal (no trigger) speed scale.- Returns:
- fraction of max linear speed during normal driving (e.g., 0.8 = 80 percent)
-
getSprintSpeedScale
public double getSprintSpeedScale()Reads the tunable sprint (right trigger) speed scale.- Returns:
- fraction of max linear speed during sprint (e.g., 1.0 = 100 percent)
-
getSlowSpeedScale
public double getSlowSpeedScale()Reads the tunable slow (left trigger) speed scale.- Returns:
- fraction of max linear speed during slow/precision mode (e.g., 0.4 = 40 percent)
-
getTriggerDeadband
public double getTriggerDeadband()Reads the tunable deadband threshold for trigger activation.- Returns:
- minimum trigger axis value to count as pressed
-
getJoystickDeadband
public double getJoystickDeadband()Reads the tunable joystick deadband for driver stick inputs.- Returns:
- current joystick deadband (fraction of full deflection, e.g., 0.08)
-
getTuningEnabled
public boolean getTuningEnabled()Reads whether tuning mode is enabled for trigger bindings.Because bindings are wired at construction, this value is only meaningful at startup. The SmartDashboard entry is still published so operators can see which mode is active.
- Returns:
trueif tuning mode is active,falsefor gameplay mode
-