Class TriggerBindingsConfig

java.lang.Object
frc.robot.shared.config.AbstractConfig
frc.robot.shared.bindings.TriggerBindingsConfig

public class TriggerBindingsConfig extends AbstractConfig
Configuration bundle for driver controller input shaping and speed tiers. Each stick axis has an independent response exponent that shapes the joystick curve, and three speed scales control how fast the robot drives depending on which trigger the driver is holding.

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.

  • Field Details

    • leftStickYResponseExponent

      public double leftStickYResponseExponent
      Response 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 leftStickXResponseExponent
      Response 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 rightStickXResponseExponent
      Response 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 normalSpeedScale
      Fraction 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 sprintSpeedScale
      Fraction 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 slowSpeedScale
      Fraction 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 triggerDeadband
      Minimum 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 joystickDeadband
      Joystick 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 tuningEnabled
      Enables 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. When false (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

      public DriverControllerConfig 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:
      true if tuning mode is active, false for gameplay mode