wpilib.command PackageΒΆ

Objects in this package allow you to implement a robot using Command-based programming. Command based programming is a design pattern to help you organize your robot programs, by organizing your robot program into components based on Command and Subsystem

The python implementation of the Command framework closely follows the Java language implementation. RobotPy has several examples of command based robots available.

Each one of the objects in the Command framework has detailed documentation available. If you need more information, for examples, tutorials, and other detailed information on programming your robot using this pattern, we recommend that you consult the Java version of the FRC Control System documentation

wpilib.command.Command([name, timeout]) The Command class is at the very core of the entire command framework.
wpilib.command.CommandGroup([name]) A CommandGroup is a list of commands which are executed in sequence.
wpilib.command.InstantCommand(name) A command that has no duration.
wpilib.command.PIDCommand(p, i, d) This class defines a Command which interacts heavily with a PID loop.
wpilib.command.PIDSubsystem(p, i, d) This class is designed to handle the case where there is a Subsystem which uses a single {@link PIDController} almost constantly (for instance, an elevator which attempts to stay at a constant height).
wpilib.command.PrintCommand(message) A PrintCommand is a command which prints out a string when it is initialized, and then immediately finishes.
wpilib.command.Scheduler() The Scheduler is a singleton which holds the top-level running commands.
wpilib.command.StartCommand(...) A StartCommand will call the start() method of another command when it is initialized and will finish immediately.
wpilib.command.Subsystem([name]) This class defines a major component of the robot.
wpilib.command.TimedCommand(...) A command that runs for a set period of time.
wpilib.command.WaitCommand(timeout) A WaitCommand will wait for a certain amount of time before finishing.
wpilib.command.WaitForChildren([...]) This command will only finish if whatever CommandGroup it is in has no active children.
wpilib.command.WaitUntilCommand(time) This will wait until the game clock reaches some value, then continue to the next command.