Class SwerveStates

java.lang.Object
frc.robot.swerve.SwerveStates

public class SwerveStates extends Object
  • Field Details

    • isFrontClosestToLeftStation

      public static final Trigger isFrontClosestToLeftStation
    • isFrontClosestToRightStation

      public static final Trigger isFrontClosestToRightStation
    • isFrontClosestToNet

      public static final Trigger isFrontClosestToNet
    • isAlignedToReef

      public static final Trigger 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

      public static edu.wpi.first.wpilibj2.command.Command alignToXDrive(DoubleSupplier xGoalMeters)
    • alignToYDrive

      public static edu.wpi.first.wpilibj2.command.Command alignToYDrive(DoubleSupplier yGoalMeters)
    • 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

      protected static edu.wpi.first.wpilibj2.command.Command pilotAimDrive(DoubleSupplier targetDegrees)
    • 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)