public class TimedCommand extends Command
TimedCommand
will wait for a timeout before finishing.
TimedCommand
is used to execute a command for a given amount of time.Constructor and Description |
---|
TimedCommand(double timeout)
Instantiates a TimedCommand with the given timeout.
|
TimedCommand(double timeout,
Subsystem requirement)
Instantiates a TimedCommand with the given timeout.
|
TimedCommand(String name,
double timeout)
Instantiates a TimedCommand with the given name and timeout.
|
TimedCommand(String name,
double timeout,
Subsystem requirement)
Instantiates a TimedCommand with the given name and timeout.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
isFinished()
Ends command when timed out.
|
cancel, clearRequirements, doesRequire, end, execute, getGroup, initialize, initSendable, interrupted, isCanceled, isCompleted, isInterruptible, isRunning, isTimedOut, requires, setInterruptible, setRunWhenDisabled, setTimeout, start, timeSinceInitialized, toString, willRunWhenDisabled
addChild, close, free, getName, getSubsystem, setName, setName, setName, setSubsystem
public TimedCommand(String name, double timeout)
name
- the name of the commandtimeout
- the time the command takes to run (seconds)public TimedCommand(double timeout)
timeout
- the time the command takes to run (seconds)public TimedCommand(String name, double timeout, Subsystem requirement)
name
- the name of the commandtimeout
- the time the command takes to run (seconds)requirement
- the subsystem that this command requirespublic TimedCommand(double timeout, Subsystem requirement)
timeout
- the time the command takes to run (seconds)requirement
- the subsystem that this command requiresprotected boolean isFinished()
isFinished
in class Command
isTimedOut()