66
77package lib .drivers ;
88
9- import edu . wpi . first . wpilibj . DriverStation ;
10- import edu . wpi . first . wpilibj . TimedRobot ;
9+ import org . littletonrobotics . junction . LoggedRobot ;
10+
1111import edu .wpi .first .wpilibj .Timer ;
1212import edu .wpi .first .wpilibj2 .command .Command ;
1313import edu .wpi .first .wpilibj2 .command .CommandScheduler ;
14- import edu .wpi .first .wpilibj2 .command .button .Trigger ;
1514import lib .utils .Tracer ;
16- import monologue .Logged ;
17- import monologue .Monologue ;
18- import monologue .Monologue .MonologueConfig ;
1915
20- /** Inspired by https://github.com/wpilibsuite/allwpilib/pull/5939 */
21- public abstract class LoggedCommandRobot extends TimedRobot implements Logged {
16+ /**
17+ * @see https://github.com/wpilibsuite/allwpilib/pull/5939
18+ */
19+ public abstract class LoggedCommandRobot extends LoggedRobot {
2220 private final Timer gcTimer = new Timer ();
2321 protected final CommandScheduler scheduler = CommandScheduler .getInstance ();
2422
25- public final Trigger disabled = new Trigger (() -> DriverStation .isDisabled ());
26- public final Trigger inTeleoperated = new Trigger (() -> DriverStation .isTeleopEnabled ());
27- public final Trigger inAutonomous = new Trigger (() -> DriverStation .isAutonomous ());
28-
2923 private Command autonCommand ;
3024
3125 public LoggedCommandRobot () {
32- this (kDefaultPeriod );
26+ this (defaultPeriodSecs );
3327 }
3428
3529 public LoggedCommandRobot (double period ) {
3630 super (period );
37- // Monologue setup
38- Monologue .setupMonologue (
39- this ,
40- "/Logged" ,
41- new MonologueConfig (DriverStation ::isFMSAttached , "" , false , true )
42- .withDatalogPrefix ("" )
43- .withOptimizeBandwidth (DriverStation ::isFMSAttached )
44- .withLazyLogging (true ));
4531
4632 gcTimer .start ();
4733 }
@@ -50,7 +36,6 @@ public LoggedCommandRobot(double period) {
5036 public void robotPeriodic () {
5137 // Profiles the Command Scheduler and Monologue
5238 Tracer .traceFunc ("CommandScheduler" , scheduler ::run );
53- Tracer .traceFunc ("Monologue" , Monologue ::updateAll );
5439
5540 // RIO memory optimization
5641 if (gcTimer .hasElapsed (5 )) {
0 commit comments