Skip to content

Conversation

@AbeetoChanito
Copy link

Add the WaitUntilAction, which blocks until a certain condition is met.

Example use case:

public Action actionShoot(double delay) {
    return new SequentialAction(
            new InstantAction(() -> intake.in()),
            new InstantAction(() -> outtake.enable()),
            new WaitUntilAction(() -> outtake.inTolerance()), // <- here
            new InstantAction(() -> intake.openGate()),
            new SleepAction(delay),
            new InstantAction(() -> intake.closeGate()),
            new InstantAction(() -> intake.store()),
            new InstantAction(() -> outtake.disable())
    );
}

This code waits for the flywheel to reach full velocity before opening the gate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant