A simple, easy-to-use command system for FTC.
View our slideshow presentation
Commands are executed through CommandRunner instances. Every Command implements three methods:
void init()- Runs once when the command startsvoid loop()- Runs continuously until finishedboolean isFinished()- Returns true when complete
Build complex behaviors by nesting commands:
Command autonomous = new Command(
new SeriesCommand(
new ParallelCommand(
new MoveArm(Arm.Targets.HIGH),
new OpenClaw()
),
new DriveForward(24)
)
);This runs MoveArm and OpenClaw simultaneously, then executes DriveForward after both complete. NOTE: These are examples, NOT built in Commands
SeriesCommand- Runs commands one after anotherParallelCommand- Runs multiple commands simultaneously
SleepCommand- Waits for a specified durationAwaitCommand- Waits until a condition becomes true (with optional timeout)CustomCommand- Executes aRunnableonce (supports lambda expressions)
SwitchCommand- Executes different commands based on a conditionStoppableCommand- Wrapper that allows pausing/stopping commands during runtimestop()- Ends the command immediatelydisable()- Pauses execution (can be re-enabled)enable()- Resumes execution
TelemetryCommand- Creates telemetry displays with method chainingtelemetryCommand .addLine("Robot Status") .addData("Position", () -> robot.getPosition()) .addDisabledTag();
Central container for all hardware and subsystems. Access via Robot.getInstance() - this class cannot be instantiated directly.
Manages saved TelemetryCommand instances mapped to enums.
getProfile(Profile profile)- Returns a copy of the specified telemetry profile
// Create a complex autonomous routine
Command auto = new SeriesCommand(
new TelemetryCommand().addLine("Starting autonomous..."),
new ParallelCommand(
new MoveArm(Arm.Targets.PICKUP),
new DriveToPosition(startPosition)
),
new AwaitCommand(() -> sensor.isPressed(), 5.0), // Wait max 5 seconds
new CustomCommand(() -> claw.close()),
new SleepCommand(1000) // Wait 1 second
);