Skip to content

Commit b3110c8

Browse files
author
James Hagborg
committed
Add waitForChildren command
1 parent 24e9655 commit b3110c8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/main/java/org/usfirst/frc/team69/util/CommandBuilder.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import edu.wpi.first.wpilibj.command.InstantCommand;
1111
import edu.wpi.first.wpilibj.command.Subsystem;
1212
import edu.wpi.first.wpilibj.command.WaitCommand;
13+
import edu.wpi.first.wpilibj.command.WaitForChildren;
1314
import edu.wpi.first.wpilibj.command.WaitUntilCommand;
1415

1516
/**
@@ -201,6 +202,17 @@ public CommandBuilder releaseAll() {
201202
return this;
202203
}
203204

205+
/**
206+
* Wait for all running parallel commands to finish before executing the
207+
* next command.
208+
*
209+
* @return This CommandBuilder object
210+
*/
211+
public CommandBuilder waitForChildren() {
212+
m_cmdGroup.addSequential(new WaitForChildren());
213+
return this;
214+
}
215+
204216
/**
205217
* Build a command. Note that for simplicity, calling this method
206218
* multiple times will return the same {@link Command} object. This

0 commit comments

Comments
 (0)