EasyStack Docs

EasySubsystemBase

#EasySubsystemBase

Java
EasySubsystemBase implements EasySubsystem, registers the subsystem with the dashboard and adds command factories that work with EasyCommandScheduler. It is abstract, so you still write init() yourself.

#Registration

The constructor registers the new subsystem with the dashboard (EasyDash.subsystem), so it shows up in the Devices tab with its current command and state:

Java
Intake intake = new Intake();

No other call is needed. Create each subsystem once and share that instance, because every instance that is created registers itself again.

#Default and Current Command

Java
intake.setDefaultCommand(intake.run(() -> intake.setPower(0.0)));

EasyCommand active = intake.getCurrentCommand();
MethodDescription
setDefaultCommand(command)Sets the default command of this subsystem in the scheduler. A default command is the one that runs when no other command is using the subsystem.
getCurrentCommand()Returns the command that the scheduler reports for this subsystem.

#Command Factories

The base class creates commands that already require this subsystem, so you do not need to pass this yourself:

MethodCreatesBehavior
run(action)RunCommandRuns the action on every loop while the command is scheduled. It does not finish on its own.
runOnce(action)InstantCommandRuns the action once and finishes.
startEnd(start, end)StartEndCommandRuns start when the command begins and end when it ends or is interrupted. It does not finish on its own.
runEnd(action, end)RunCommand with finallyDoRuns the action on every loop, and runs end when the command ends or is interrupted.

A command that does not finish on its own is ended by a decorator such as until() or withTimeout(), by a command group, or by another command taking over the subsystem.

Java
EasyCommand collect = intake.startEnd(
        () -> intake.setPower(1.0),
        () -> intake.setPower(0.0));

EasyCommand pulse = intake.runOnce(() -> intake.setPower(0.5))
        .andThen(new WaitCommand(300))
        .andThen(intake.runOnce(() -> intake.setPower(0.0)));

runEnd() is run() with a cleanup action. The inner command is wrapped with finallyDo, which runs end after the inner command ends and ignores whether it was interrupted.

Last updated 2026-11-16

EasyStack - FTC Java library

This site records page views of visitors to understand how the documentation is used. Nothing is sold or shared with third parties.