Class BaseDriveSubsystem

All Implemented Interfaces:
Sendable, Subsystem, DataFrameRefreshable, IPropertySupport
Direct Known Subclasses:
BaseSwerveDriveSubsystem, MockDriveSubsystem

public abstract class BaseDriveSubsystem extends BaseSubsystem
  • Field Details

    • lastRawCommandedDirection

      public Translation2d lastRawCommandedDirection
    • lastRawCommandedRotation

      public double lastRawCommandedRotation
    • kThrottleDeadband

      public static final double kThrottleDeadband
      See Also:
  • Constructor Details

    • BaseDriveSubsystem

      public BaseDriveSubsystem()
  • Method Details

    • getPositionalPid

      public abstract PIDManager getPositionalPid()
    • getRotateToHeadingPid

      public abstract PIDManager getRotateToHeadingPid()
    • getRotateDecayPid

      public abstract PIDManager getRotateDecayPid()
    • move

      public abstract void move(XYPair translate, double rotate)
    • getLeftTotalDistance

      public abstract double getLeftTotalDistance()
      Returns the total distance tracked by the encoder - On the LEFT side of the robot - Pointing in the direction of +Y travel
    • getRightTotalDistance

      public abstract double getRightTotalDistance()
      Returns the total distance tracked by the encoder - On the RIGHT side of the robot - Pointing in the direction of +Y travel
    • getTransverseDistance

      public abstract double getTransverseDistance()
      Returns the total distance tracked by the encoder - In the center of the robot - Pointing in the direction of +X travel
    • drive

      public void drive(XYPair translation, double rotation, boolean normalize)
      Commands each of the XCANTalons to respond to translation/rotation input. Each "wheel" is independently responsible, and as such there isn't any actual drive logic in this method.
      Parameters:
      translation - +Y is towards the front of the robot, +X is towards the right of the robot. Range between -1 and 1.
      rotation - +Rotation is left turn, -Rotation is right turn. Range between -1 and 1.
      normalize - If the largest output is greater than 1, should all outputs be normalized so that 1 is the maximum?
    • drive

      public void drive(XYPair translation, double rotation)
      Commands each of the XCANTalons to respond to translation/rotation input. Each "wheel" is independently responsible, and as such there isn't any actual drive logic in this method.
      Parameters:
      translation - +Y is towards the front of the robot, +X is towards the right of the robot. Range between -1 and 1
      rotation - +Rotation is left turn, -Rotation is right turn. Range between -1 and 1.
    • drive

      public void drive(double left, double right)
      Classic tank drive.
      Parameters:
      left - Power to the left drive motor. Range between -1 and 1.
      right - Power to the right drive motor. Range between -1 and 1.
    • fieldOrientedDrive

      public void fieldOrientedDrive(XYPair translation, double rotation, double currentHeading, boolean normalize)
    • setQuickTurn

      public void setQuickTurn(boolean value)
    • cheesyDrive

      public void cheesyDrive(double translation, double rotation)
      Slightly adapted from 254's 2016 CheesyDriveHelper.java.
    • stop

      public void stop()
    • arcadeDrive

      public void arcadeDrive(double yTranslation, double rotation)
      Classic arcade drive
      Parameters:
      yTranslation - Translation power. Range between -1 and 1.
      rotation - Rotation power. Range between -1 and 1.
    • tankDrive

      public void tankDrive(double left, double right)
      Classic tank drive.
      Parameters:
      left - Power to the left drive motor. Range between -1 and 1.
      right - Power to the right drive motor. Range between -1 and 1.
    • getMaxOutput

      protected double getMaxOutput(XYPair translation, double rotation)
      Determine the largest commanded output for a given wheel for a given translation/rotation input. For example, you would see a maximum output of two in a Tank Drive system that's commanded to go forward at full speed AND rotate at full speed.