Robot Core Documentation
|
Additional Inherited Members | |
![]() | |
Command () | |
![]() | |
Set< Subsystem > | m_requirements = new HashSet<>() |
A command that runs another command repeatedly, restarting it when it ends, until this command is interrupted. Command instances that are passed to it cannot be added to any other groups, or scheduled individually.
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
edu.wpi.first.wpilibj2.command.RepeatCommand.RepeatCommand | ( | Command | command | ) |
Creates a new RepeatCommand. Will run another command repeatedly, restarting it whenever it ends, until this command is interrupted.
command | the command to run repeatedly |
void edu.wpi.first.wpilibj2.command.RepeatCommand.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.RepeatCommand.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.RepeatCommand.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.RepeatCommand.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.RepeatCommand.initSendable | ( | SendableBuilder | builder | ) |
Initializes this Sendable
object.
builder | sendable builder |
Reimplemented from edu.wpi.first.wpilibj2.command.Command.
boolean edu.wpi.first.wpilibj2.command.RepeatCommand.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.RepeatCommand.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.