InstantCommand

class commands2.InstantCommand(*args, **kwargs)[source]

Bases: FunctionalCommand

A Command that runs instantly; it will initialize, execute once, and end on the same iteration of the scheduler. Users can either pass in a Callable and a set of requirements, or else subclass this command if desired.

Creates a new InstantCommand that runs the given Callable with the given requirements.

Parameters:
  • toRun – the Runnable to run

  • requirements – the subsystems required by this command