Class TeleopControls

java.lang.Object
frc.robot.subsystems.swerve.util.TeleopControls

@NullMarked public class TeleopControls extends Object
Control scheme utilities for teleoperated swerve driving.

This class converts raw driver input signals (typically joystick axes) into ChassisSpeeds suitable for commanding a swerve drivetrain. Input processing includes deadbanding, non-linear shaping, and scaling to configured maximum translational and rotational speeds.

The resulting chassis speeds are intended to be consumed by higher-level drive commands (robot-relative or field-relative) rather than applied directly to hardware.

  • Constructor Details

    • TeleopControls

      public TeleopControls()
  • Method Details

    • teleopControls

      public static Supplier<ChassisSpeeds> teleopControls(DoubleSupplier forward, DoubleSupplier right, DoubleSupplier turnCCW)
      Creates a supplier that converts driver inputs into desired chassis speeds.

      The returned Supplier performs the following processing each time it is evaluated:

      • Applies a configurable deadband to all input axes
      • Applies non-linear shaping to translational inputs for finer low-speed control
      • Scales translational and rotational inputs to configured maximum speeds

      The produced ChassisSpeeds are expressed in a pseudo-field-relative frame, where:

      • Forward input corresponds to positive X velocity
      • Rightward input corresponds to positive Y velocity
      • Counterclockwise input corresponds to positive angular velocity

      This method does not perform true field-relative conversion; callers are expected to apply any required frame transformations using the robot's current heading.

      Parameters:
      forward - supplier providing the forward/backward driver input
      right - supplier providing the left/right driver input
      turnCCW - supplier providing the counterclockwise rotation input
      Returns:
      a supplier that generates processed ChassisSpeeds for teleop control