RobotCore 1.0
WPILib port to raspberry Pi
Loading...
Searching...
No Matches
org.wpilib.command3.SequentialGroup Class Reference
Inheritance diagram for org.wpilib.command3.SequentialGroup:
org.wpilib.command3.Command

Public Member Functions

void run (Coroutine coroutine)
String name ()
Set< Mechanism > requirements ()
int priority ()
String toString ()
Public Member Functions inherited from org.wpilib.command3.Command
default void onCancel ()
default void onExit ()
default boolean isLowerPriorityThan (Command other)
default boolean requires (Mechanism mechanism)
default boolean conflictsWith (Command other)
default Command withTimeout (Time timeout)
default ParallelGroupBuilder until (BooleanSupplier endCondition)
default SequentialGroupBuilder andThen (Command next)
default ParallelGroupBuilder alongWith (Command... parallel)
default ParallelGroupBuilder raceWith (Command... parallel)

Additional Inherited Members

Static Public Member Functions inherited from org.wpilib.command3.Command
static NeedsNameBuilderStage noRequirements (Consumer< Coroutine > body)
static NeedsExecutionBuilderStage requiring (Mechanism requirement, Mechanism... rest)
static NeedsExecutionBuilderStage requiring (Collection< Mechanism > requirements)
static ParallelGroupBuilder parallel (Command... commands)
static ParallelGroupBuilder race (Command... commands)
static SequentialGroupBuilder sequence (Command... commands)
static NeedsNameBuilderStage waitUntil (BooleanSupplier condition)
static NeedsNameBuilderStage waitFor (Time duration)
Public Attributes inherited from org.wpilib.command3.Command
int DEFAULT_PRIORITY = 0
int LOWEST_PRIORITY = Integer.MIN_VALUE
int HIGHEST_PRIORITY = Integer.MAX_VALUE

Detailed Description

A sequence of commands that run one after another. Each successive command only starts after its predecessor completes execution. The priority of a sequence is equal to the highest priority of any of its commands. If all commands in the sequence are able to run while the robot is disabled, then the sequence itself will be allowed to run while the robot is disabled.

The sequence will own all mechanisms required by all commands in the sequence for the entire duration of the sequence. This means that a mechanism owned by one command in the sequence, but not by a later one, will be uncommanded while that later command executes.

Definition at line 24 of file SequentialGroup.java.

Member Function Documentation

◆ name()

String org.wpilib.command3.SequentialGroup.name ( )

The name of the command.

Returns
the name of the command

Implements org.wpilib.command3.Command.

Definition at line 62 of file SequentialGroup.java.

◆ priority()

int org.wpilib.command3.SequentialGroup.priority ( )

The priority of the command. If a command is scheduled that conflicts with another running or pending command, their priority values are compared to determine which should run. If the scheduled command is lower priority than the running command, then it will not be scheduled and the running command will continue to run. If it is the same or higher priority, then the running command will be canceled and the scheduled command will start to run.

Returns
the priority of the command

Implements org.wpilib.command3.Command.

Definition at line 72 of file SequentialGroup.java.

◆ requirements()

Set< Mechanism > org.wpilib.command3.SequentialGroup.requirements ( )

The mechanisms required by the command. This is used by the scheduler to determine if two commands conflict with each other. No mechanism may be required by more than one running command at a time.

Returns
the set of mechanisms required by the command

Implements org.wpilib.command3.Command.

Definition at line 67 of file SequentialGroup.java.

◆ run()

void org.wpilib.command3.SequentialGroup.run ( Coroutine coroutine)

Runs the command. Commands that need to periodically run until a goal state is reached should simply run a while loop like while (!atGoal()) { ... } and call Coroutine#yield() at the end of the loop.

Warning: any loops in a command must call coroutine.yield(). Failure to do so will prevent anything else in your robot code from running. Commands are opt-in collaborative constructs; don't be greedy!

Parameters
coroutinethe coroutine backing the command's execution

Implements org.wpilib.command3.Command.

Definition at line 55 of file SequentialGroup.java.

◆ toString()

String org.wpilib.command3.SequentialGroup.toString ( )

Definition at line 77 of file SequentialGroup.java.


The documentation for this class was generated from the following file: