Class BaseSetpointSubsystem<T>

Type Parameters:
T - The type of the target value.
All Implemented Interfaces:
Sendable, Subsystem, DataFrameRefreshable, SupportsSetpointLock, IPropertySupport
Direct Known Subclasses:
SwerveDriveSubsystem, SwerveSteeringSubsystem

public abstract class BaseSetpointSubsystem<T> extends BaseSubsystem implements SupportsSetpointLock
Base class for subsystems that have a setpoint managed by a maintainer.
  • Field Details

    • atGoal

      protected boolean atGoal
    • lastTargetValueUsedforAtGoal

      protected T lastTargetValueUsedforAtGoal
  • Constructor Details

    • BaseSetpointSubsystem

      public BaseSetpointSubsystem()
  • Method Details

    • getSetpointLock

      public Subsystem getSetpointLock()
      Specified by:
      getSetpointLock in interface SupportsSetpointLock
    • isMaintainerAtGoal

      public boolean isMaintainerAtGoal()
    • setMaintainerIsAtGoal

      public void setMaintainerIsAtGoal(boolean atGoal)
    • getCurrentValue

      public abstract T getCurrentValue()
    • getTargetValue

      public abstract T getTargetValue()
    • setTargetValue

      public abstract void setTargetValue(T value)
    • setPower

      public abstract void setPower(double power)
    • isCalibrated

      public abstract boolean isCalibrated()
    • areTwoTargetsEquivalent

      protected abstract boolean areTwoTargetsEquivalent(T target1, T target2)
    • createSetTargetCommand

      public SetTargetCommand<T> createSetTargetCommand()
    • createSetTargetCommand

      public SetTargetCommand<T> createSetTargetCommand(T value)
    • areTwoDoublesEquivalent

      public static boolean areTwoDoublesEquivalent(double target1, double target2)
    • areTwoDoublesEquivalent

      public static boolean areTwoDoublesEquivalent(double target1, double target2, double tolerance)