RobotCore
Robot Core Documentation
Public Member Functions | Static Public Member Functions | List of all members
edu.wpi.first.wpilibj2.command.CommandGroupBase Class Referenceabstract
Inheritance diagram for edu.wpi.first.wpilibj2.command.CommandGroupBase:
edu.wpi.first.wpilibj2.command.CommandBase edu.wpi.first.wpilibj2.command.Command edu.wpi.first.wpilibj2.command.ParallelCommandGroup edu.wpi.first.wpilibj2.command.ParallelDeadlineGroup edu.wpi.first.wpilibj2.command.ParallelRaceGroup edu.wpi.first.wpilibj2.command.SequentialCommandGroup

Public Member Functions

abstract void addCommands (Command... commands)
 
- Public Member Functions inherited from edu.wpi.first.wpilibj2.command.CommandBase
final void addRequirements (Subsystem... requirements)
 
Set< SubsystemgetRequirements ()
 
- Public Member Functions inherited from edu.wpi.first.wpilibj2.command.Command
default void initialize ()
 
default void execute ()
 
default void end (boolean interrupted)
 
default boolean isFinished ()
 
default ParallelRaceGroup withTimeout (double seconds)
 
default ParallelRaceGroup withInterrupt (BooleanSupplier condition)
 
default SequentialCommandGroup beforeStarting (Runnable toRun, Subsystem... requirements)
 
default SequentialCommandGroup andThen (Runnable toRun, Subsystem... requirements)
 
default SequentialCommandGroup andThen (Command... next)
 
default ParallelDeadlineGroup deadlineWith (Command... parallel)
 
default ParallelCommandGroup alongWith (Command... parallel)
 
default ParallelRaceGroup raceWith (Command... parallel)
 
default PerpetualCommand perpetually ()
 
default ProxyScheduleCommand asProxy ()
 
default void schedule (boolean interruptible)
 
default void schedule ()
 
default void cancel ()
 
default boolean isScheduled ()
 
default boolean hasRequirement (Subsystem requirement)
 
default boolean runsWhenDisabled ()
 
default String getName ()
 

Static Public Member Functions

static void clearGroupedCommands ()
 
static void clearGroupedCommand (Command command)
 
static void requireUngrouped (Command... commands)
 
static void requireUngrouped (Collection< Command > commands)
 
static CommandGroupBase sequence (Command... commands)
 
static CommandGroupBase parallel (Command... commands)
 
static CommandGroupBase race (Command... commands)
 
static CommandGroupBase deadline (Command deadline, Command... commands)
 

Additional Inherited Members

- Protected Attributes inherited from edu.wpi.first.wpilibj2.command.CommandBase
Set< Subsystemm_requirements = new HashSet<>()
 

Detailed Description

A base for CommandGroups. Statically tracks commands that have been allocated to groups to ensure those commands are not also used independently, which can result in inconsistent command state and unpredictable execution.

Member Function Documentation

◆ addCommands()

abstract void edu.wpi.first.wpilibj2.command.CommandGroupBase.addCommands ( Command...  commands)
abstract

◆ clearGroupedCommand()

static void edu.wpi.first.wpilibj2.command.CommandGroupBase.clearGroupedCommand ( Command  command)
static

Removes a single command from the list of grouped commands, allowing it to be freely used again.

WARNING: Using this haphazardly can result in unexpected/undesirable behavior. Do not use this unless you fully understand what you are doing.

Parameters
commandthe command to remove from the list of grouped commands

◆ clearGroupedCommands()

static void edu.wpi.first.wpilibj2.command.CommandGroupBase.clearGroupedCommands ( )
static

Clears the list of grouped commands, allowing all commands to be freely used again.

WARNING: Using this haphazardly can result in unexpected/undesirable behavior. Do not use this unless you fully understand what you are doing.

◆ deadline()

static CommandGroupBase edu.wpi.first.wpilibj2.command.CommandGroupBase.deadline ( Command  deadline,
Command...  commands 
)
static

Factory method for ParallelDeadlineGroup, included for brevity/convenience.

Parameters
deadlinethe deadline command
commandsthe commands to include
Returns
the command group

◆ parallel()

static CommandGroupBase edu.wpi.first.wpilibj2.command.CommandGroupBase.parallel ( Command...  commands)
static

Factory method for ParallelCommandGroup, included for brevity/convenience.

Parameters
commandsthe commands to include
Returns
the command group

◆ race()

static CommandGroupBase edu.wpi.first.wpilibj2.command.CommandGroupBase.race ( Command...  commands)
static

Factory method for ParallelRaceGroup, included for brevity/convenience.

Parameters
commandsthe commands to include
Returns
the command group

◆ requireUngrouped() [1/2]

static void edu.wpi.first.wpilibj2.command.CommandGroupBase.requireUngrouped ( Collection< Command commands)
static

Requires that the specified commands not have been already allocated to a CommandGroup. Throws an IllegalArgumentException if commands have been allocated.

Parameters
commandsThe commands to check

◆ requireUngrouped() [2/2]

static void edu.wpi.first.wpilibj2.command.CommandGroupBase.requireUngrouped ( Command...  commands)
static

Requires that the specified commands not have been already allocated to a CommandGroup. Throws an IllegalArgumentException if commands have been allocated.

Parameters
commandsThe commands to check

◆ sequence()

static CommandGroupBase edu.wpi.first.wpilibj2.command.CommandGroupBase.sequence ( Command...  commands)
static

Factory method for SequentialCommandGroup, included for brevity/convenience.

Parameters
commandsthe commands to include
Returns
the command group

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