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 classCommandBaseASendablebase class forCommands.classCommandGroupBaseA base for CommandGroups.classConditionalCommandRuns one of two commands, depending on the value of the given condition when this command is initialized.classFunctionalCommandA command that allows the user to pass in functions for each of the basic command methods through the constructor.classInstantCommandA Command that runs instantly; it will initialize, execute once, and end on the same iteration of the scheduler.classNotifierCommandA command that starts a notifier to run the given runnable periodically in a separate thread.classParallelCommandGroupA CommandGroup that runs a set of commands in parallel, ending when the last command ends.classParallelDeadlineGroupA 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.classParallelRaceGroupA CommandGroup that runs a set of commands in parallel, ending when any one of the commands ends and interrupting all the others.classPerpetualCommandA command that runs another command in perpetuity, ignoring that command's end conditions.classPIDCommandA command that controls an output with aPIDController.classPrintCommandA command that prints a string when initialized.classProxyScheduleCommandSchedules the given commands when this command is initialized, and ends when all the commands are no longer scheduled.classRunCommandA command that runs a Runnable continuously.classScheduleCommandSchedules the given commands when this command is initialized.classSelectCommandRuns 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.classSequentialCommandGroupA CommandGroups that runs a list of commands in sequence.classStartEndCommandA command that runs a given runnable when it is initalized, and another runnable when it ends.classWaitCommandA command that does nothing but takes a specified amount of time to finish.classWaitUntilCommandA 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 CommandCommand. alongWith(Command... parallel)Decorates this command with a set of commands to run parallel to it, ending when the last command ends.default CommandCommand. andThen(Command... next)Decorates this command with a set of commands to run after it in sequence.default CommandCommand. asProxy()Decorates this command to run "by proxy" by wrapping it in aProxyScheduleCommand.default CommandCommand. beforeStarting(java.lang.Runnable toRun)Decorates this command with a runnable to run before this command starts.default CommandCommand. 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 CommandSubsystem. getCurrentCommand()Returns the command currently running on this subsystem.CommandCommandScheduler. getDefaultCommand(Subsystem subsystem)Gets the default command associated with this subsystem.default CommandSubsystem. getDefaultCommand()Gets the default command for this subsystem.default CommandCommand. interruptOn(java.util.function.BooleanSupplier condition)Decorates this command with an interrupt condition.default CommandCommand. perpetually()Decorates this command to run perpetually, ignoring its ordinary end conditions.default CommandCommand. raceWith(Command... parallel)Decorates this command with a set of commands to run parallel to it, ending when the first command ends.CommandCommandScheduler. requiring(Subsystem subsystem)Returns the command currently requiring a given subsystem.default CommandCommand. whenFinished(java.lang.Runnable toRun)Decorates this command with a runnable to run after the command finishes.default CommandCommand. 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 voidCommandGroupBase. addCommands(Command... commands)Adds the given commands to the command group.voidParallelCommandGroup. addCommands(Command... commands)voidParallelDeadlineGroup. addCommands(Command... commands)voidParallelRaceGroup. addCommands(Command... commands)voidSequentialCommandGroup. addCommands(Command... commands)default CommandCommand. alongWith(Command... parallel)Decorates this command with a set of commands to run parallel to it, ending when the last command ends.default CommandCommand. andThen(Command... next)Decorates this command with a set of commands to run after it in sequence.voidCommandScheduler. cancel(Command... commands)Cancels commands.static voidCommandGroupBase. clearGroupedCommand(Command command)Removes a single command from the list of grouped commands, allowing it to be freely used again.static CommandGroupBaseCommandGroupBase. deadline(Command deadline, Command... commands)Factory method forParallelDeadlineGroup, included for brevity/convenience.default CommandCommand. 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.booleanCommandScheduler. isScheduled(Command... commands)Whether the given commands are running.static CommandGroupBaseCommandGroupBase. parallel(Command... commands)Factory method forParallelCommandGroup, included for brevity/convenience.static CommandGroupBaseCommandGroupBase. race(Command... commands)Factory method forParallelRaceGroup, included for brevity/convenience.default CommandCommand. raceWith(Command... parallel)Decorates this command with a set of commands to run parallel to it, ending when the first command ends.static voidCommandGroupBase. requireUngrouped(Command... commands)Requires that the specified commands not have been already allocated to a CommandGroup.voidCommandScheduler. schedule(boolean interruptible, Command... commands)Schedules multiple commands for execution.voidCommandScheduler. schedule(Command... commands)Schedules multiple commands for execution, with interruptible defaulted to true.static CommandGroupBaseCommandGroupBase. sequence(Command... commands)Factory method forSequentialCommandGroup, included for brevity/convenience.voidParallelDeadlineGroup. setDeadline(Command deadline)Sets the deadline to the given command.voidCommandScheduler. setDefaultCommand(Subsystem subsystem, Command defaultCommand)Sets the default command for a subsystem.default voidSubsystem. setDefaultCommand(Command defaultCommand)Sets the defaultCommandof the subsystem.doubleCommandScheduler. 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 voidCommandScheduler. onCommandExecute(java.util.function.Consumer<Command> action)Adds an action to perform on the execution of any command by the scheduler.voidCommandScheduler. onCommandFinish(java.util.function.Consumer<Command> action)Adds an action to perform on the finishing of any command by the scheduler.voidCommandScheduler. onCommandInitialize(java.util.function.Consumer<Command> action)Adds an action to perform on the initialization of any command by the scheduler.voidCommandScheduler. onCommandInterrupt(java.util.function.Consumer<Command> action)Adds an action to perform on the interruption of any command by the scheduler.static voidCommandGroupBase. 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 TriggerTrigger. cancelWhenActive(Command command)Cancels a command when the trigger becomes active.ButtonButton. cancelWhenPressed(Command command)Cancels the command when the button is pressed.TriggerTrigger. toggleWhenActive(Command command)Toggles a command when the trigger becomes active.TriggerTrigger. toggleWhenActive(Command command, boolean interruptible)Toggles a command when the trigger becomes active.ButtonButton. toggleWhenPressed(Command command)Toggles the command whenever the button is pressed (on then off then on).ButtonButton. toggleWhenPressed(Command command, boolean interruptible)Toggles the command whenever the button is pressed (on then off then on).TriggerTrigger. whenActive(Command command)Starts the given command whenever the trigger just becomes active.TriggerTrigger. whenActive(Command command, boolean interruptible)Starts the given command whenever the trigger just becomes active.ButtonButton. 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.ButtonButton. 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.TriggerTrigger. whenInactive(Command command)Starts the command when the trigger becomes inactive.TriggerTrigger. whenInactive(Command command, boolean interruptible)Starts the command when the trigger becomes inactive.ButtonButton. whenPressed(Command command)Starts the given command whenever the button is newly pressed.ButtonButton. whenPressed(Command command, boolean interruptible)Starts the given command whenever the button is newly pressed.ButtonButton. whenReleased(Command command)Starts the command when the button is released.ButtonButton. whenReleased(Command command, boolean interruptible)Starts the command when the button is released.TriggerTrigger. whileActiveContinuous(Command command)Constantly starts the given command while the button is held.TriggerTrigger. whileActiveContinuous(Command command, boolean interruptible)Constantly starts the given command while the button is held.TriggerTrigger. 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.TriggerTrigger. 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.ButtonButton. whileHeld(Command command)Constantly starts the given command while the button is held.ButtonButton. whileHeld(Command command, boolean interruptible)Constantly starts the given command while the button is held.