Package frc.robot.swerve
Class SwerveStates
java.lang.Object
frc.robot.swerve.SwerveStates
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static edu.wpi.first.wpilibj2.command.Command
aimDrive
(DoubleSupplier velocityX, DoubleSupplier velocityY, DoubleSupplier targetRadians) Reset the turn controller and then run the drive command with a angle supplier.static edu.wpi.first.wpilibj2.command.Command
alignDrive
(DoubleSupplier xGoalMeters, DoubleSupplier yGoalMeters, DoubleSupplier headingRadians) static edu.wpi.first.wpilibj2.command.Command
alignToXDrive
(DoubleSupplier xGoalMeters) static edu.wpi.first.wpilibj2.command.Command
alignToYDrive
(DoubleSupplier yGoalMeters) static edu.wpi.first.wpilibj2.command.Command
alignXYDrive
(DoubleSupplier xGoalMeters, DoubleSupplier yGoalMeters) static edu.wpi.first.wpilibj2.command.Command
autonAlgaeDriveIntake
(double timeout) static edu.wpi.first.wpilibj2.command.Command
protected static edu.wpi.first.wpilibj2.command.Command
protected static edu.wpi.first.wpilibj2.command.Command
fpvAimDrive
(DoubleSupplier velocityX, DoubleSupplier velocityY, DoubleSupplier targetRadians) protected static edu.wpi.first.wpilibj2.command.Command
fpvDrive()
protected static edu.wpi.first.wpilibj2.command.Command
headingLock
(DoubleSupplier velocityX, DoubleSupplier velocityY) Reset the turn controller, set the target heading to the current heading(end that command immediately), and then run the drive command with the Rotation controller.protected static edu.wpi.first.wpilibj2.command.Command
protected static edu.wpi.first.wpilibj2.command.Command
lockToClosest45deg
(DoubleSupplier velocityX, DoubleSupplier velocityY) protected static edu.wpi.first.wpilibj2.command.Command
protected static edu.wpi.first.wpilibj2.command.Command
lockToClosestFieldAngle
(DoubleSupplier velocityX, DoubleSupplier velocityY) protected static edu.wpi.first.wpilibj2.command.Command
protected static edu.wpi.first.wpilibj2.command.Command
log
(edu.wpi.first.wpilibj2.command.Command cmd) protected static edu.wpi.first.wpilibj2.command.Command
pilotAimDrive
(DoubleSupplier targetDegrees) protected static edu.wpi.first.wpilibj2.command.Command
Drive the robot using left stick and control orientation using the right stick.static edu.wpi.first.wpilibj2.command.Command
static edu.wpi.first.wpilibj2.command.Command
static edu.wpi.first.wpilibj2.command.Command
protected static edu.wpi.first.wpilibj2.command.Command
protected static edu.wpi.first.wpilibj2.command.Command
******************************************************************************************* Reorient Commandsprotected static edu.wpi.first.wpilibj2.command.Command
protected static edu.wpi.first.wpilibj2.command.Command
protected static edu.wpi.first.wpilibj2.command.Command
protected static edu.wpi.first.wpilibj2.command.Command
************************************************************************* Helper Commands ************************************************************************protected static edu.wpi.first.wpilibj2.command.Command
protected static void
protected static edu.wpi.first.wpilibj2.command.Command
setTargetHeading
(DoubleSupplier targetHeading) protected static void
protected static edu.wpi.first.wpilibj2.command.Command
protected static edu.wpi.first.wpilibj2.command.Command
protected static edu.wpi.first.wpilibj2.command.Command
xBrake()
Turn the swerve wheels to an X to prevent the robot from moving
-
Field Details
-
isFrontClosestToLeftStation
-
isFrontClosestToRightStation
-
isFrontClosestToNet
-
isAlignedToReef
-
-
Constructor Details
-
SwerveStates
public SwerveStates()
-
-
Method Details
-
setupDefaultCommand
protected static void setupDefaultCommand() -
setStates
protected static void setStates() -
pilotDrive
protected static edu.wpi.first.wpilibj2.command.Command pilotDrive()Drive the robot using left stick and control orientation using the right stick. -
autonAlgaeDriveIntake
public static edu.wpi.first.wpilibj2.command.Command autonAlgaeDriveIntake(double timeout) -
reefAimDriveVisionTA
public static edu.wpi.first.wpilibj2.command.Command reefAimDriveVisionTA() -
autonAlgaeReefAimDriveVisionXY
public static edu.wpi.first.wpilibj2.command.Command autonAlgaeReefAimDriveVisionXY() -
reefAimDriveVisionXY
public static edu.wpi.first.wpilibj2.command.Command reefAimDriveVisionXY() -
reefAimDrive
public static edu.wpi.first.wpilibj2.command.Command reefAimDrive() -
alignToXDrive
-
alignToYDrive
-
alignXYDrive
public static edu.wpi.first.wpilibj2.command.Command alignXYDrive(DoubleSupplier xGoalMeters, DoubleSupplier yGoalMeters) -
alignDrive
public static edu.wpi.first.wpilibj2.command.Command alignDrive(DoubleSupplier xGoalMeters, DoubleSupplier yGoalMeters, DoubleSupplier headingRadians) -
snapSteerDrive
protected static edu.wpi.first.wpilibj2.command.Command snapSteerDrive() -
fpvDrive
protected static edu.wpi.first.wpilibj2.command.Command fpvDrive() -
pilotAimDrive
-
snakeDrive
protected static edu.wpi.first.wpilibj2.command.Command snakeDrive() -
headingLockDrive
protected static edu.wpi.first.wpilibj2.command.Command headingLockDrive() -
lockToClosest45degDrive
protected static edu.wpi.first.wpilibj2.command.Command lockToClosest45degDrive() -
lockToClosestFieldAngleDrive
protected static edu.wpi.first.wpilibj2.command.Command lockToClosestFieldAngleDrive() -
xBrake
protected static edu.wpi.first.wpilibj2.command.Command xBrake()Turn the swerve wheels to an X to prevent the robot from moving -
resetXController
protected static edu.wpi.first.wpilibj2.command.Command resetXController()************************************************************************* Helper Commands ************************************************************************ -
resetYController
protected static edu.wpi.first.wpilibj2.command.Command resetYController() -
resetTurnController
protected static edu.wpi.first.wpilibj2.command.Command resetTurnController() -
setTargetHeading
protected static edu.wpi.first.wpilibj2.command.Command setTargetHeading(DoubleSupplier targetHeading) -
fpvAimDrive
protected static edu.wpi.first.wpilibj2.command.Command fpvAimDrive(DoubleSupplier velocityX, DoubleSupplier velocityY, DoubleSupplier targetRadians) -
aimDrive
protected static edu.wpi.first.wpilibj2.command.Command aimDrive(DoubleSupplier velocityX, DoubleSupplier velocityY, DoubleSupplier targetRadians) Reset the turn controller and then run the drive command with a angle supplier. This can be used for aiming at a goal or heading locking, etc. -
headingLock
protected static edu.wpi.first.wpilibj2.command.Command headingLock(DoubleSupplier velocityX, DoubleSupplier velocityY) Reset the turn controller, set the target heading to the current heading(end that command immediately), and then run the drive command with the Rotation controller. The rotation controller will only engage if you are driving x or y. -
lockToClosest45deg
protected static edu.wpi.first.wpilibj2.command.Command lockToClosest45deg(DoubleSupplier velocityX, DoubleSupplier velocityY) -
lockToClosestFieldAngle
protected static edu.wpi.first.wpilibj2.command.Command lockToClosestFieldAngle(DoubleSupplier velocityX, DoubleSupplier velocityY) -
reorientForward
protected static edu.wpi.first.wpilibj2.command.Command reorientForward()******************************************************************************************* Reorient Commands -
reorientLeft
protected static edu.wpi.first.wpilibj2.command.Command reorientLeft() -
reorientBack
protected static edu.wpi.first.wpilibj2.command.Command reorientBack() -
reorientRight
protected static edu.wpi.first.wpilibj2.command.Command reorientRight() -
cardinalReorient
protected static edu.wpi.first.wpilibj2.command.Command cardinalReorient() -
log
protected static edu.wpi.first.wpilibj2.command.Command log(edu.wpi.first.wpilibj2.command.Command cmd)
-