Package edu.wpi.first.wpilibj.command
Class WaitForChildren
- java.lang.Object
-
- edu.wpi.first.wpilibj.command.Command
-
- edu.wpi.first.wpilibj.command.WaitForChildren
-
- All Implemented Interfaces:
Sendable,AutoCloseable
public class WaitForChildren extends Command
This command will only finish if whateverCommandGroupit is in has no active children. If it is not a part of aCommandGroup, then it will finish immediately. If it is itself an active child, then theCommandGroupwill never end.This class is useful for the situation where you want to allow anything running in parallel to finish, before continuing in the main
CommandGroupsequence.
-
-
Constructor Summary
Constructors Constructor Description WaitForChildren()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected booleanisFinished()Returns whether this command is finished.-
Methods inherited from class edu.wpi.first.wpilibj.command.Command
cancel, clearRequirements, close, doesRequire, end, execute, getGroup, getName, getSubsystem, initialize, initSendable, interrupted, isCanceled, isCompleted, isInterruptible, isRunning, isTimedOut, requires, setInterruptible, setName, setRunWhenDisabled, setSubsystem, setTimeout, start, timeSinceInitialized, toString, willRunWhenDisabled
-
-
-
-
Method Detail
-
isFinished
protected boolean isFinished()
Description copied from class:CommandReturns whether this command is finished. If it is, then the command will be removed andend()will be called.It may be useful for a team to reference the
isTimedOut()method for time-sensitive commands.Returning false will result in the command never ending automatically. It may still be cancelled manually or interrupted by another command. Returning true will result in the command executing once and finishing immediately. We recommend using
InstantCommandfor this.- Specified by:
isFinishedin classCommand- Returns:
- whether this command is finished.
- See Also:
isTimedOut()
-
-