Class TeleopControls
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Supplier<ChassisSpeeds>teleopControls(DoubleSupplier forward, DoubleSupplier right, DoubleSupplier turnCCW) Creates a supplier that converts driver inputs into desired chassis speeds.
-
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
Supplierperforms 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
ChassisSpeedsare 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 inputright- supplier providing the left/right driver inputturnCCW- supplier providing the counterclockwise rotation input- Returns:
- a supplier that generates processed
ChassisSpeedsfor teleop control
-