Package com.uniforge.origin.command
Class WaitUntilCommand
java.lang.Object
com.uniforge.origin.command.Command
com.uniforge.origin.command.WaitUntilCommand
- All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable
A command that does nothing but ends after a specified match time or condition. Useful for
CommandGroups.
This class is provided by the NewCommands VendorDep
-
Nested Class Summary
Nested classes/interfaces inherited from class com.uniforge.origin.command.Command
Command.InterruptionBehavior -
Field Summary
Fields inherited from class com.uniforge.origin.command.Command
m_requirements -
Constructor Summary
ConstructorsConstructorDescriptionWaitUntilCommand(double time) Creates a new WaitUntilCommand that ends after a given match time.WaitUntilCommand(BooleanSupplier condition) Creates a new WaitUntilCommand that ends after a given condition becomes true. -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether the command has finished.booleanWhether the given command should run when the robot is disabled.Methods inherited from class com.uniforge.origin.command.Command
addRequirements, alongWith, andThen, andThen, asProxy, beforeStarting, beforeStarting, cancel, deadlineWith, end, errorDetected, execute, finallyDo, finallyDo, getInterruptionBehavior, getName, getRequirements, getSubsystem, handleInterrupt, hasRequirement, ignoringDisable, initialize, initSendable, isScheduled, onlyIf, onlyWhile, raceWith, repeatedly, schedule, setErrorDetected, setName, setSubsystem, unless, until, withInterruptBehavior, withName, withTimeout
-
Constructor Details
-
WaitUntilCommand
Creates a new WaitUntilCommand that ends after a given condition becomes true.- Parameters:
condition- the condition to determine when to end
-
WaitUntilCommand
public WaitUntilCommand(double time) Creates a new WaitUntilCommand that ends after a given match time.NOTE: The match timer used for this command is UNOFFICIAL. Using this command does NOT guarantee that the time at which the action is performed will be judged to be legal by the referees. When in doubt, add a safety factor or time the action manually.
- Parameters:
time- the match time after which to end, in seconds
-
-
Method Details
-
isFinished
public boolean isFinished()Description copied from class:CommandWhether the command has finished. Once a command finishes, the scheduler will call its end() method and un-schedule it.- Overrides:
isFinishedin classCommand- Returns:
- whether the command has finished.
-
runsWhenDisabled
public boolean runsWhenDisabled()Description copied from class:CommandWhether the given command should run when the robot is disabled. Override to return true if the command should run when disabled.- Overrides:
runsWhenDisabledin classCommand- Returns:
- whether the command should run when the robot is disabled
-