Class Drivetrain


public class Drivetrain extends FSMSystem<Drivetrain.DrivetrainState>
  • Constructor Details

    • Drivetrain

      public Drivetrain()
      Constructs the drivetrain subsystem.
  • Method Details

    • reset

      public void reset()
      Description copied from class: FSMSystem
      Reset the current FSM state.
      Specified by:
      reset in class FSMSystem<Drivetrain.DrivetrainState>
    • update

      public void update(Input input)
      Description copied from class: FSMSystem
      Update the FSM state periodically based on inputs.
      Specified by:
      update in class FSMSystem<Drivetrain.DrivetrainState>
      Parameters:
      input - the input object
    • getPose

      public edu.wpi.first.math.geometry.Pose2d getPose()
      Get the drivetrain pose.
      Returns:
      the pose
    • getChassisSpeeds

      public edu.wpi.first.math.kinematics.ChassisSpeeds getChassisSpeeds()
      Get the drivetrain chassis speeds.
      Returns:
      the chassis speeds
    • getModuleStates

      public edu.wpi.first.math.kinematics.SwerveModuleState[] getModuleStates()
      Get the drivetrain swerve states.
      Returns:
      the swerve module states
    • getModuleTargets

      public edu.wpi.first.math.kinematics.SwerveModuleState[] getModuleTargets()
      Get the drivetrain swerve targets.
      Returns:
      the swerve module targets
    • getModulePositions

      public edu.wpi.first.math.kinematics.SwerveModulePosition[] getModulePositions()
      Get the drivetrain swerve positions.
      Returns:
      the swerve module positions
    • nextState

      protected Drivetrain.DrivetrainState nextState(Input input)
      Description copied from class: FSMSystem
      Get the next state for the FSM based on inputs.
      Specified by:
      nextState in class FSMSystem<Drivetrain.DrivetrainState>
      Parameters:
      input - the input object
      Returns:
      the next state
    • getCurrentState

      public Drivetrain.DrivetrainState getCurrentState()
      Get the current state of the Drivetrain subsystem.
      Overrides:
      getCurrentState in class FSMSystem<Drivetrain.DrivetrainState>
      Returns:
      current state of the drivetrain
    • targetHub

      public void targetHub()
      Aligns the bot to target the hub for shooting.
    • targetPassZone

      public void targetPassZone(edu.wpi.first.math.geometry.Pose2d targetPose)
      Aligns the bot to target the passing target.
      Parameters:
      targetPose - the target passing pose