ImmediateAction

Overview

ImmediateAction is a special RR Action that runs another action only once and does not wait for it to complete.

This is useful when you want to trigger an action at a specific point in the sequence and move on immediately.


Usage

ImmediateAction(Action)

runBlocking(
    new SequentialAction(
        new ImmediateAction(new MotorToPositionAction(armMotor, 1000)),  // Extend arm and don't wait for it to finish
        new SleepUntilAction(() -> armMotor.getCurrentPosition() > 500), // Wait for motor to reach 500 ticks
        new ServoToPositionAction(claw, 0.0)                             // Open claw
    )
);

Last updated