Package frc.robot.subsystems
Class DrivetrainControls
java.lang.Object
frc.robot.subsystems.DrivetrainControls
-
Field Summary
FieldsModifier and TypeFieldDescriptiondoubleSpeed multiplier used for scaling controller inputs (0, 1]. -
Constructor Summary
ConstructorsConstructorDescriptionDrivetrainControls(CommandSwerveDrivetrain drivetrain) Creates a new DrivetrainControls. -
Method Summary
Modifier and TypeMethodDescriptionfeildCentricFacingAngleRequest(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 feildfieldCentricRequest(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 centersetPose2()setSpeedMultiplierCommand(Supplier<Double> speedMultiplier) Sets the controller speed multiplier.
-
Field Details
-
brake
-
speedMultiplier
public double speedMultiplierSpeed multiplier used for scaling controller inputs (0, 1].
-
-
Constructor Details
-
DrivetrainControls
Creates a new DrivetrainControls.- Parameters:
drivetrain- The Drivetrain to control.
-
-
Method Details
-
setSpeedMultiplierCommand
Sets the controller speed multiplier. Resets the multiplier when canceled.- Parameters:
speedMultiplier- Multiplier to set (0, 1].- Returns:
- Command to run.
-
feildCentricFacingAngleRequest
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
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
-