public class WaitUntilCommand extends CommandBase
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 interface edu.wpi.first.wpilibj2.command.Command
Fields inherited from class edu.wpi.first.wpilibj2.command.CommandBase
Constructors Constructor Description
WaitUntilCommand(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.
Modifier and Type Method Description
isFinished()Whether the command has finished.
runsWhenDisabled()Whether the given command should run when the robot is disabled.
Methods inherited from class edu.wpi.first.wpilibj2.command.CommandBase
addRequirements, getName, getRequirements, 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.Command
alongWith, andThen, andThen, asProxy, beforeStarting, beforeStarting, cancel, deadlineWith, end, execute, finallyDo, getInterruptionBehavior, handleInterrupt, hasRequirement, ignoringDisable, initialize, isScheduled, perpetually, raceWith, repeatedly, schedule, unless, until, withInterrupt, withInterruptBehavior, withName, withTimeout
WaitUntilCommandpublic WaitUntilCommand(BooleanSupplier condition)Creates a new WaitUntilCommand that ends after a given condition becomes true.
condition- the condition to determine when to end
WaitUntilCommandpublic 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.
time- the match time after which to end, in seconds
isFinishedpublic boolean isFinished()Description copied from interface:
CommandWhether the command has finished. Once a command finishes, the scheduler will call its end() method and un-schedule it.
- whether the command has finished.
runsWhenDisabledpublic boolean runsWhenDisabled()Description copied from interface:
CommandWhether the given command should run when the robot is disabled. Override to return true if the command should run when disabled.
- whether the command should run when the robot is disabled