Class DrivetrainControls

java.lang.Object
frc.robot.subsystems.DrivetrainControls

public class DrivetrainControls extends Object
  • Field Details

    • brake

      public final SwerveRequest.SwerveDriveBrake brake
    • speedMultiplier

      public double speedMultiplier
      Speed multiplier used for scaling controller inputs (0, 1].
  • Constructor Details

    • DrivetrainControls

      public DrivetrainControls(CommandSwerveDrivetrain drivetrain)
      Creates a new DrivetrainControls.
      Parameters:
      drivetrain - The Drivetrain to control.
  • Method Details

    • setSpeedMultiplierCommand

      public Command setSpeedMultiplierCommand(Supplier<Double> speedMultiplier)
      Sets the controller speed multiplier. Resets the multiplier when canceled.
      Parameters:
      speedMultiplier - Multiplier to set (0, 1].
      Returns:
      Command to run.
    • feildCentricFacingAngleRequest

      public SwerveRequest feildCentricFacingAngleRequest(CommandXboxController driverController)
      Controls Swerve Request for drivetrian with the facing angle type Left stick drives the robot with field centric control Right stick points robot in direction relitive to feild
      Parameters:
      driverController -
      Returns:
      Swerve Request
    • fieldCentricRequest

      public SwerveRequest fieldCentricRequest(CommandXboxController driverController)
      Controls the swerve drive with the field centric type Left stick drives the robot with field centric control Right stick turn the robot according to the x value spinning clockwise or counterclockwise around the center
      Parameters:
      driverController -
      Returns:
      Swerve Request
    • setPose2