Package xbot.common.command
Class BaseSetpointSubsystem<T>
java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
xbot.common.command.BaseSubsystem
xbot.common.command.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 Summary
FieldsFields inherited from class xbot.common.command.BaseSubsystem
aKitLog, dataFrameRefreshables, log -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanareTwoDoublesEquivalent(double target1, double target2) static booleanareTwoDoublesEquivalent(double target1, double target2, double tolerance) protected abstract booleanareTwoTargetsEquivalent(T target1, T target2) createSetTargetCommand(T value) abstract Tabstract Tabstract booleanbooleanvoidsetMaintainerIsAtGoal(boolean atGoal) abstract voidsetPower(double power) abstract voidsetTargetValue(T value) Methods inherited from class xbot.common.command.BaseSubsystem
getPrefix, periodic, refreshDataFrame, registerDataFrameRefreshableMethods inherited from class edu.wpi.first.wpilibj2.command.SubsystemBase
addChild, getName, getSubsystem, initSendable, setName, setSubsystemMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface edu.wpi.first.wpilibj2.command.Subsystem
defer, getCurrentCommand, getDefaultCommand, register, removeDefaultCommand, run, runEnd, runOnce, setDefaultCommand, simulationPeriodic, startEnd, startRun
-
Field Details
-
atGoal
protected boolean atGoal -
lastTargetValueUsedforAtGoal
-
-
Constructor Details
-
BaseSetpointSubsystem
public BaseSetpointSubsystem()
-
-
Method Details
-
getSetpointLock
- Specified by:
getSetpointLockin interfaceSupportsSetpointLock
-
isMaintainerAtGoal
public boolean isMaintainerAtGoal() -
setMaintainerIsAtGoal
public void setMaintainerIsAtGoal(boolean atGoal) -
getCurrentValue
-
getTargetValue
-
setTargetValue
-
setPower
public abstract void setPower(double power) -
isCalibrated
public abstract boolean isCalibrated() -
areTwoTargetsEquivalent
-
createSetTargetCommand
-
createSetTargetCommand
-
areTwoDoublesEquivalent
public static boolean areTwoDoublesEquivalent(double target1, double target2) -
areTwoDoublesEquivalent
public static boolean areTwoDoublesEquivalent(double target1, double target2, double tolerance)
-