Package frc.robot.subsystems.drivetrain
Class DrivetrainControls
java.lang.Object
frc.robot.subsystems.drivetrain.DrivetrainControls
Class that contains utility functions for controlling the
Drivetrain
with HID controllers.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SwerveInputStream
driveAngularVelocity
(Drivetrain drivetrain, CommandXboxController controller) Converts driver input into a field-relative ChassisSpeeds that is controlled by angular velocity.static SwerveInputStream
driveDirectAngle
(Drivetrain drivetrain, CommandXboxController controller) Clones the angular velocity input stream and converts it to a fieldRelative input stream.static SwerveInputStream
driveDirectAngleSim
(Drivetrain drivetrain, CommandXboxController controller) A copy ofdriveDirectAngle(frc.robot.subsystems.drivetrain.Drivetrain,edu.wpi.first.wpilibj2.command.button.CommandXboxController)
that pulls rotation from controller axis 2 for use in simulation.
-
Constructor Details
-
DrivetrainControls
public DrivetrainControls()
-
-
Method Details
-
driveAngularVelocity
public static SwerveInputStream driveAngularVelocity(Drivetrain drivetrain, CommandXboxController controller) Converts driver input into a field-relative ChassisSpeeds that is controlled by angular velocity.- Parameters:
drivetrain
- the drivetrain to controlcontroller
- the controller to read from- Returns:
- SwerveInputStream with data from the controller
-
driveDirectAngle
public static SwerveInputStream driveDirectAngle(Drivetrain drivetrain, CommandXboxController controller) Clones the angular velocity input stream and converts it to a fieldRelative input stream.- Parameters:
drivetrain
- the drivetrain to controlcontroller
- the controller to read from- Returns:
- SwerveInputStream with data from the controller
-
driveDirectAngleSim
public static SwerveInputStream driveDirectAngleSim(Drivetrain drivetrain, CommandXboxController controller) A copy ofdriveDirectAngle(frc.robot.subsystems.drivetrain.Drivetrain,edu.wpi.first.wpilibj2.command.button.CommandXboxController)
that pulls rotation from controller axis 2 for use in simulation.- Parameters:
drivetrain
- the drivetrain to controlcontroller
- the controller to read from- Returns:
- SwerveInputStream with data from the controller
-