Uses of Interface
edu.wpi.first.wpilibj2.command.Command
Package | Description |
---|---|
edu.wpi.first.wpilibj2.command | |
edu.wpi.first.wpilibj2.command.button |
-
Uses of Command in edu.wpi.first.wpilibj2.command
Classes in edu.wpi.first.wpilibj2.command that implement Command Modifier and Type Class Description class
CommandBase
ASendable
base class forCommand
s.class
CommandGroupBase
A base for CommandGroups.class
ConditionalCommand
Runs one of two commands, depending on the value of the given condition when this command is initialized.class
FunctionalCommand
A command that allows the user to pass in functions for each of the basic command methods through the constructor.class
InstantCommand
A Command that runs instantly; it will initialize, execute once, and end on the same iteration of the scheduler.class
NotifierCommand
A command that starts a notifier to run the given runnable periodically in a separate thread.class
ParallelCommandGroup
A CommandGroup that runs a set of commands in parallel, ending when the last command ends.class
ParallelDeadlineGroup
A CommandGroup that runs a set of commands in parallel, ending only when a specific command (the "deadline") ends, interrupting all other commands that are still running at that point.class
ParallelRaceGroup
A CommandGroup that runs a set of commands in parallel, ending when any one of the commands ends and interrupting all the others.class
PerpetualCommand
A command that runs another command in perpetuity, ignoring that command's end conditions.class
PIDCommand
A command that controls an output with aPIDController
.class
PrintCommand
A command that prints a string when initialized.class
ProxyScheduleCommand
Schedules the given commands when this command is initialized, and ends when all the commands are no longer scheduled.class
RunCommand
A command that runs a Runnable continuously.class
ScheduleCommand
Schedules the given commands when this command is initialized.class
SelectCommand
Runs one of a selection of commands, either using a selector and a key to command mapping, or a supplier that returns the command directly at runtime.class
SequentialCommandGroup
A CommandGroups that runs a list of commands in sequence.class
StartEndCommand
A command that runs a given runnable when it is initalized, and another runnable when it ends.class
WaitCommand
A command that does nothing but takes a specified amount of time to finish.class
WaitUntilCommand
A command that does nothing but ends after a specified match time or condition.Methods in edu.wpi.first.wpilibj2.command that return Command Modifier and Type Method Description default Command
Command. alongWith(Command... parallel)
Decorates this command with a set of commands to run parallel to it, ending when the last command ends.default Command
Command. andThen(Command... next)
Decorates this command with a set of commands to run after it in sequence.default Command
Command. asProxy()
Decorates this command to run "by proxy" by wrapping it in aProxyScheduleCommand
.default Command
Command. beforeStarting(java.lang.Runnable toRun)
Decorates this command with a runnable to run before this command starts.default Command
Command. deadlineWith(Command... parallel)
Decorates this command with a set of commands to run parallel to it, ending when the calling command ends and interrupting all the others.default Command
Subsystem. getCurrentCommand()
Returns the command currently running on this subsystem.Command
CommandScheduler. getDefaultCommand(Subsystem subsystem)
Gets the default command associated with this subsystem.default Command
Subsystem. getDefaultCommand()
Gets the default command for this subsystem.default Command
Command. interruptOn(java.util.function.BooleanSupplier condition)
Decorates this command with an interrupt condition.default Command
Command. perpetually()
Decorates this command to run perpetually, ignoring its ordinary end conditions.default Command
Command. raceWith(Command... parallel)
Decorates this command with a set of commands to run parallel to it, ending when the first command ends.Command
CommandScheduler. requiring(Subsystem subsystem)
Returns the command currently requiring a given subsystem.default Command
Command. whenFinished(java.lang.Runnable toRun)
Decorates this command with a runnable to run after the command finishes.default Command
Command. withTimeout(double seconds)
Decorates this command with a timeout.Methods in edu.wpi.first.wpilibj2.command with parameters of type Command Modifier and Type Method Description abstract void
CommandGroupBase. addCommands(Command... commands)
Adds the given commands to the command group.void
ParallelCommandGroup. addCommands(Command... commands)
void
ParallelDeadlineGroup. addCommands(Command... commands)
void
ParallelRaceGroup. addCommands(Command... commands)
void
SequentialCommandGroup. addCommands(Command... commands)
default Command
Command. alongWith(Command... parallel)
Decorates this command with a set of commands to run parallel to it, ending when the last command ends.default Command
Command. andThen(Command... next)
Decorates this command with a set of commands to run after it in sequence.void
CommandScheduler. cancel(Command... commands)
Cancels commands.static void
CommandGroupBase. clearGroupedCommand(Command command)
Removes a single command from the list of grouped commands, allowing it to be freely used again.static CommandGroupBase
CommandGroupBase. deadline(Command deadline, Command... commands)
Factory method forParallelDeadlineGroup
, included for brevity/convenience.default Command
Command. deadlineWith(Command... parallel)
Decorates this command with a set of commands to run parallel to it, ending when the calling command ends and interrupting all the others.boolean
CommandScheduler. isScheduled(Command... commands)
Whether the given commands are running.static CommandGroupBase
CommandGroupBase. parallel(Command... commands)
Factory method forParallelCommandGroup
, included for brevity/convenience.static CommandGroupBase
CommandGroupBase. race(Command... commands)
Factory method forParallelRaceGroup
, included for brevity/convenience.default Command
Command. raceWith(Command... parallel)
Decorates this command with a set of commands to run parallel to it, ending when the first command ends.static void
CommandGroupBase. requireUngrouped(Command... commands)
Requires that the specified commands not have been already allocated to a CommandGroup.void
CommandScheduler. schedule(boolean interruptible, Command... commands)
Schedules multiple commands for execution.void
CommandScheduler. schedule(Command... commands)
Schedules multiple commands for execution, with interruptible defaulted to true.static CommandGroupBase
CommandGroupBase. sequence(Command... commands)
Factory method forSequentialCommandGroup
, included for brevity/convenience.void
ParallelDeadlineGroup. setDeadline(Command deadline)
Sets the deadline to the given command.void
CommandScheduler. setDefaultCommand(Subsystem subsystem, Command defaultCommand)
Sets the default command for a subsystem.default void
Subsystem. setDefaultCommand(Command defaultCommand)
Sets the defaultCommand
of the subsystem.double
CommandScheduler. timeSinceScheduled(Command command)
Returns the time since a given command was scheduled.Method parameters in edu.wpi.first.wpilibj2.command with type arguments of type Command Modifier and Type Method Description void
CommandScheduler. onCommandExecute(java.util.function.Consumer<Command> action)
Adds an action to perform on the execution of any command by the scheduler.void
CommandScheduler. onCommandFinish(java.util.function.Consumer<Command> action)
Adds an action to perform on the finishing of any command by the scheduler.void
CommandScheduler. onCommandInitialize(java.util.function.Consumer<Command> action)
Adds an action to perform on the initialization of any command by the scheduler.void
CommandScheduler. onCommandInterrupt(java.util.function.Consumer<Command> action)
Adds an action to perform on the interruption of any command by the scheduler.static void
CommandGroupBase. requireUngrouped(java.util.Collection<Command> commands)
Requires that the specified commands not have been already allocated to a CommandGroup.Constructors in edu.wpi.first.wpilibj2.command with parameters of type Command Constructor Description ConditionalCommand(Command onTrue, Command onFalse, java.util.function.BooleanSupplier condition)
Creates a new ConditionalCommand.ParallelCommandGroup(Command... commands)
Creates a new ParallelCommandGroup.ParallelDeadlineGroup(Command deadline, Command... commands)
Creates a new ParallelDeadlineGroup.ParallelRaceGroup(Command... commands)
Creates a new ParallelCommandRace.PerpetualCommand(Command command)
Creates a new PerpetualCommand.ProxyScheduleCommand(Command... toSchedule)
Creates a new ProxyScheduleCommand that schedules the given commands when initialized, and ends when they are all no longer scheduled.ScheduleCommand(Command... toSchedule)
Creates a new ScheduleCommand that schedules the given commands when initialized.SequentialCommandGroup(Command... commands)
Creates a new SequentialCommandGroup.Constructor parameters in edu.wpi.first.wpilibj2.command with type arguments of type Command Constructor Description SelectCommand(java.util.function.Supplier<Command> toRun)
Creates a new selectcommand.SelectCommand(java.util.Map<java.lang.Object,Command> commands, java.util.function.Supplier<java.lang.Object> selector)
Creates a new selectcommand. -
Uses of Command in edu.wpi.first.wpilibj2.command.button
Methods in edu.wpi.first.wpilibj2.command.button with parameters of type Command Modifier and Type Method Description Trigger
Trigger. cancelWhenActive(Command command)
Cancels a command when the trigger becomes active.Button
Button. cancelWhenPressed(Command command)
Cancels the command when the button is pressed.Trigger
Trigger. toggleWhenActive(Command command)
Toggles a command when the trigger becomes active.Trigger
Trigger. toggleWhenActive(Command command, boolean interruptible)
Toggles a command when the trigger becomes active.Button
Button. toggleWhenPressed(Command command)
Toggles the command whenever the button is pressed (on then off then on).Button
Button. toggleWhenPressed(Command command, boolean interruptible)
Toggles the command whenever the button is pressed (on then off then on).Trigger
Trigger. whenActive(Command command)
Starts the given command whenever the trigger just becomes active.Trigger
Trigger. whenActive(Command command, boolean interruptible)
Starts the given command whenever the trigger just becomes active.Button
Button. whenHeld(Command command)
Starts the given command when the button is first pressed, and cancels it when it is released, but does not start it again if it ends or is otherwise interrupted.Button
Button. whenHeld(Command command, boolean interruptible)
Starts the given command when the button is first pressed, and cancels it when it is released, but does not start it again if it ends or is otherwise interrupted.Trigger
Trigger. whenInactive(Command command)
Starts the command when the trigger becomes inactive.Trigger
Trigger. whenInactive(Command command, boolean interruptible)
Starts the command when the trigger becomes inactive.Button
Button. whenPressed(Command command)
Starts the given command whenever the button is newly pressed.Button
Button. whenPressed(Command command, boolean interruptible)
Starts the given command whenever the button is newly pressed.Button
Button. whenReleased(Command command)
Starts the command when the button is released.Button
Button. whenReleased(Command command, boolean interruptible)
Starts the command when the button is released.Trigger
Trigger. whileActiveContinuous(Command command)
Constantly starts the given command while the button is held.Trigger
Trigger. whileActiveContinuous(Command command, boolean interruptible)
Constantly starts the given command while the button is held.Trigger
Trigger. whileActiveOnce(Command command)
Starts the given command when the trigger initially becomes active, and ends it when it becomes inactive, but does not re-start it in-between.Trigger
Trigger. whileActiveOnce(Command command, boolean interruptible)
Starts the given command when the trigger initially becomes active, and ends it when it becomes inactive, but does not re-start it in-between.Button
Button. whileHeld(Command command)
Constantly starts the given command while the button is held.Button
Button. whileHeld(Command command, boolean interruptible)
Constantly starts the given command while the button is held.