Class BaseSetpointSubsystem<TargetT,PowerT>
java.lang.Object
org.wpilib.command2.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:
org.wpilib.command2.Subsystem, org.wpilib.telemetry.TelemetryLoggable, SupportsSetpointLock, TunablePrefixProvider
- 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 BaseSubsystem
aKitLog, 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 TargetTorg.wpilib.command2.Subsystemabstract TargetTabstract booleanbooleanvoidsetMaintainerIsAtGoal(boolean atGoal) abstract voidabstract voidsetTargetValue(TargetT value) Methods inherited from class BaseSubsystem
getPrefix, periodicMethods inherited from class org.wpilib.command2.SubsystemBase
getName, getTelemetryType, logTo, setNameMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.wpilib.command2.Subsystem
defer, getCurrentCommand, getDefaultCommand, idle, register, removeDefaultCommand, run, runEnd, runOnce, setDefaultCommand, simulationPeriodic, startEnd, startRun
-
Field Details
-
atGoal
protected boolean atGoal -
lastTargetValueUsedforAtGoal
-
-
Constructor Details
-
BaseSetpointSubsystem
public BaseSetpointSubsystem()
-
-
Method Details
-
getSetpointLock
public org.wpilib.command2.Subsystem 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)
-