File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,9 @@ simgui-ds.json
5
5
.glass /glass.json
6
6
.Glass /glass.json
7
7
8
+ /sim-logs /*
9
+ ! /sim-logs /.gitkeep
10
+
8
11
9
12
# This gitignore has been specially created by the WPILib team.
10
13
# If you remove items from this file, intellisense might break.
Original file line number Diff line number Diff line change 68
68
import frc .robot .util .RedHawkUtil ;
69
69
import frc .robot .util .RumbleManager ;
70
70
import frc .robot .util .SwerveHeadingController ;
71
+ import java .text .SimpleDateFormat ;
72
+ import java .util .Calendar ;
71
73
import java .util .Optional ;
74
+ import org .littletonrobotics .junction .LogFileUtil ;
72
75
import org .littletonrobotics .junction .LoggedRobot ;
73
76
import org .littletonrobotics .junction .Logger ;
74
77
import org .littletonrobotics .junction .networktables .LoggedDashboardChooser ;
75
78
import org .littletonrobotics .junction .networktables .NT4Publisher ;
79
+ import org .littletonrobotics .junction .wpilog .WPILOGReader ;
76
80
import org .littletonrobotics .junction .wpilog .WPILOGWriter ;
77
81
import org .littletonrobotics .urcl .URCL ;
78
82
@@ -114,6 +118,18 @@ public void robotInit() {
114
118
Logger .recordMetadata ("BuildDate" , GVersion .BUILD_DATE );
115
119
if (isReal ()) {
116
120
Logger .addDataReceiver (new WPILOGWriter ());
121
+ } else {
122
+ Logger .addDataReceiver (
123
+ new WPILOGWriter (
124
+ "sim-logs/"
125
+ + new SimpleDateFormat ("yyyyMMdd_HHmmss" ).format (Calendar .getInstance ().getTime ())
126
+ + ".wpilog" ));
127
+ if (System .getenv ("AKIT_LOG_PATH" ) != null ) {
128
+ String logPath =
129
+ LogFileUtil
130
+ .findReplayLog (); // Pull the replay log from AdvantageScope (or prompt the user)
131
+ Logger .setReplaySource (new WPILOGReader (logPath )); // Read replay log
132
+ }
117
133
}
118
134
119
135
Logger .start ();
You can’t perform that action at this time.
0 commit comments