Class AutoEnd

java.lang.Object
frc.robot.auton.AutoEnd

public final class AutoEnd extends Object
Logs why the auto command ended and how long it ran. Nine TXMAN1 autos stopped between 2.5 and 17.9 s, and nothing in those logs said whether the auto finished, was interrupted, or the robot was disabled.

The scheduler's finish and interrupt callbacks run on the main thread inside the scheduler, and every input the reason reads (the Driver Station's enable, E-stop, FMS, DS attached and match time) is an AdvantageKit input, so a replayed log gives the same reason.

  • Constructor Details

    • AutoEnd

      public AutoEnd()
  • Method Details

    • onEnded

      public void onEnded(Consumer<AutoEnd.Ended> listener)
      Sets the one listener told when an auto ends, on the main thread, after it is logged.
      Parameters:
      listener - told the reason, the interrupting command and the elapsed time
    • start

      public void start(Command command, double timeLimitSeconds)
      Schedules an auto and watches how it ends.
      Parameters:
      command - the auto
      timeLimitSeconds - cancel it after this long, or Double.POSITIVE_INFINITY