Class AutoEnd
java.lang.Object
frc.robot.auton.AutoEnd
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordHow an auto ended, as logged.static enumWhy the auto command ended. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidonEnded(Consumer<AutoEnd.Ended> listener) Sets the one listener told when an auto ends, on the main thread, after it is logged.voidSchedules an auto and watches how it ends.
-
Constructor Details
-
AutoEnd
public AutoEnd()
-
-
Method Details
-
onEnded
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
Schedules an auto and watches how it ends.- Parameters:
command- the autotimeLimitSeconds- cancel it after this long, orDouble.POSITIVE_INFINITY
-