Package frc.lib.util
Class DisabledInstantCommand
java.lang.Object
edu.wpi.first.wpilibj2.command.Command
edu.wpi.first.wpilibj2.command.FunctionalCommand
edu.wpi.first.wpilibj2.command.InstantCommand
frc.lib.util.DisabledInstantCommand
- All Implemented Interfaces:
Sendable
A Command that runs instantly; it will initialize, execute once, and end on the same iteration of
the scheduler. Users can either pass in a Runnable and a set of requirements, or else subclass
this command if desired.
This command works while the robot is disabled.
-
Nested Class Summary
Nested classes/interfaces inherited from class edu.wpi.first.wpilibj2.command.Command
Command.InterruptionBehavior -
Field Summary
Fields inherited from class edu.wpi.first.wpilibj2.command.Command
m_requirements -
Constructor Summary
ConstructorsConstructorDescriptionDisabledInstantCommand(Runnable toRun, Subsystem... requirements) Creates a new InstantCommand that runs the given Runnable with the given requirements. -
Method Summary
Methods inherited from class edu.wpi.first.wpilibj2.command.FunctionalCommand
end, execute, initialize, isFinishedMethods inherited from class edu.wpi.first.wpilibj2.command.Command
addRequirements, alongWith, andThen, andThen, asProxy, beforeStarting, beforeStarting, cancel, deadlineWith, finallyDo, finallyDo, getInterruptionBehavior, getName, getRequirements, getSubsystem, handleInterrupt, hasRequirement, ignoringDisable, initSendable, isScheduled, onlyIf, onlyWhile, raceWith, repeatedly, schedule, setName, setSubsystem, unless, until, withInterruptBehavior, withName, withTimeout
-
Constructor Details
-
DisabledInstantCommand
Creates a new InstantCommand that runs the given Runnable with the given requirements.This command works while the robot is disabled.
- Parameters:
toRun- the Runnable to runrequirements- the subsystems required by this command
-
-
Method Details
-
runsWhenDisabled
public boolean runsWhenDisabled()- Overrides:
runsWhenDisabledin classCommand
-