Class SequentialTask

java.lang.Object
com.cdarobotics.cdalib.tasks.Task
com.cdarobotics.cdalib.tasks.SequentialTask

public class SequentialTask extends Task
Runs its child tasks one after another, advancing to the next only when the current one finishes. Completes when the last child finishes (or immediately if there are no children).
  • Constructor Details

    • SequentialTask

      public SequentialTask(Task... tasks)
      Parameters:
      tasks - the tasks to run in order, one after another.
  • Method Details

    • init

      public void init()
      Description copied from class: Task
      Called once before the first Task.run(). Set up state and issue starting commands here.
      Specified by:
      init in class Task
    • run

      public boolean run()
      Description copied from class: Task
      Called every loop after Task.init().
      Specified by:
      run in class Task
      Returns:
      true when the task is finished, false to keep running.
    • toString

      @NonNull public String toString()
      Specified by:
      toString in class Task