Robot Core Documentation
|
Additional Inherited Members | |
![]() | |
Command () | |
![]() | |
Set< Subsystem > | m_requirements = new HashSet<>() |
A command composition that runs one of a selection of commands using a selector and a key to command mapping.
The rules for command compositions apply: command instances that are passed to it cannot be added to any other composition or scheduled individually, and the composition requires all subsystems its components require.
This class is provided by the NewCommands VendorDep
<K> | The type of key used to select the command |
edu.wpi.first.wpilibj2.command.SelectCommand< K >.SelectCommand | ( | Map< K, Command > | commands, |
Supplier<? extends K > | selector ) |
Creates a new SelectCommand.
commands | the map of commands to choose from |
selector | the selector to determine which command to run |
void edu.wpi.first.wpilibj2.command.SelectCommand< K >.end | ( | boolean | interrupted | ) |
The action to take when the command ends. Called when either the command finishes normally, or when it interrupted/canceled.
Do not schedule commands here that share requirements with this command. Use andThen(Command...)
instead.
interrupted | whether the command was interrupted/canceled |
Reimplemented from edu.wpi.first.wpilibj2.command.Command.
void edu.wpi.first.wpilibj2.command.SelectCommand< K >.execute | ( | ) |
The main body of a command. Called repeatedly while the command is scheduled.
Reimplemented from edu.wpi.first.wpilibj2.command.Command.
InterruptionBehavior edu.wpi.first.wpilibj2.command.SelectCommand< K >.getInterruptionBehavior | ( | ) |
How the command behaves when another command with a shared requirement is scheduled.
InterruptionBehavior
, defaulting to kCancelSelf
. Reimplemented from edu.wpi.first.wpilibj2.command.Command.
void edu.wpi.first.wpilibj2.command.SelectCommand< K >.initialize | ( | ) |
The initial subroutine of a command. Called once when the command is initially scheduled.
Reimplemented from edu.wpi.first.wpilibj2.command.Command.
void edu.wpi.first.wpilibj2.command.SelectCommand< K >.initSendable | ( | SendableBuilder | builder | ) |
Initializes this Sendable
object.
builder | sendable builder |
Reimplemented from edu.wpi.first.wpilibj2.command.Command.
boolean edu.wpi.first.wpilibj2.command.SelectCommand< K >.isFinished | ( | ) |
Whether the command has finished. Once a command finishes, the scheduler will call its end() method and un-schedule it.
Reimplemented from edu.wpi.first.wpilibj2.command.Command.
boolean edu.wpi.first.wpilibj2.command.SelectCommand< K >.runsWhenDisabled | ( | ) |
Whether the given command should run when the robot is disabled. Override to return true if the command should run when disabled.
Reimplemented from edu.wpi.first.wpilibj2.command.Command.