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
Fields inherited from class xbot.common.command.BaseSubsystem
aKitLog, dataFrameRefreshables, log
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
areTwoDoublesEquivalent
(double target1, double target2) static boolean
areTwoDoublesEquivalent
(double target1, double target2, double tolerance) protected abstract boolean
areTwoTargetsEquivalent
(T target1, T target2) createSetTargetCommand
(T value) abstract T
abstract T
abstract boolean
boolean
void
setMaintainerIsAtGoal
(boolean atGoal) abstract void
setPower
(double power) abstract void
setTargetValue
(T value) Methods inherited from class xbot.common.command.BaseSubsystem
getPrefix, periodic, refreshDataFrame, registerDataFrameRefreshable
Methods inherited from class edu.wpi.first.wpilibj2.command.SubsystemBase
addChild, getName, getSubsystem, initSendable, setName, setSubsystem
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
getSetpointLock
in 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)
-