Package lib.commands
Class ThresholdCommand<T extends Comparable<T>>
java.lang.Object
edu.wpi.first.wpilibj2.command.Command
lib.commands.ThresholdCommand<T>
- All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable
public class ThresholdCommand<T extends Comparable<T>>
extends edu.wpi.first.wpilibj2.command.Command
Threshold command takes in a command, a supplier, and a threshold. When the
threshold is passed by the supplier, it starts the command. When the
threshold stops being passed, it cancels the command.
-
Nested Class Summary
Nested classes/interfaces inherited from class edu.wpi.first.wpilibj2.command.Command
edu.wpi.first.wpilibj2.command.Command.InterruptionBehavior -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionThresholdCommand(edu.wpi.first.wpilibj2.command.Command command, Supplier<T> axis, T threshold) ThresholdCommand(edu.wpi.first.wpilibj2.command.Command command, Supplier<T> supplier, T threshold, boolean invert) ThresholdCommand(String name, edu.wpi.first.wpilibj2.command.Command command, Supplier<T> supplier, T threshold, boolean invert) -
Method Summary
Methods inherited from class edu.wpi.first.wpilibj2.command.Command
addRequirements, addRequirements, alongWith, andThen, andThen, asProxy, beforeStarting, beforeStarting, cancel, deadlineFor, deadlineWith, end, finallyDo, finallyDo, getInterruptionBehavior, getName, getRequirements, getSubsystem, handleInterrupt, hasRequirement, ignoringDisable, initialize, initSendable, isFinished, isScheduled, onlyIf, onlyWhile, raceWith, repeatedly, runsWhenDisabled, schedule, setName, setSubsystem, unless, until, withDeadline, withInterruptBehavior, withName, withTimeout, withTimeout
-
Field Details
-
command
protected final edu.wpi.first.wpilibj2.command.Command command -
supplier
-
threshold
-
invert
protected final boolean invert
-
-
Constructor Details
-
ThresholdCommand
-
ThresholdCommand
-
ThresholdCommand
-
-
Method Details
-
pastThreshold
protected boolean pastThreshold() -
execute
public void execute()- Overrides:
executein classedu.wpi.first.wpilibj2.command.Command
-