Package xbot.common.command
Class BaseSetpointSubsystem<TargetT,PowerT>
java.lang.Object
edu.wpi.first.wpilibj2.command.SubsystemBase
xbot.common.command.BaseSubsystem
xbot.common.command.BaseSetpointSubsystem<TargetT,PowerT>
- Type Parameters:
TargetT- The type of the target value.PowerT- The type of the power value.
- All Implemented Interfaces:
Sendable,Subsystem,DataFrameRefreshable,SupportsSetpointLock,IPropertySupport
- Direct Known Subclasses:
BaseSimpleSetpointSubsystem
public abstract class BaseSetpointSubsystem<TargetT,PowerT>
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(TargetT target1, TargetT target2) createSetTargetCommand(TargetT value) abstract TargetTabstract TargetTabstract booleanbooleanvoidsetMaintainerIsAtGoal(boolean atGoal) abstract voidabstract voidsetTargetValue(TargetT 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
-
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)
-