Skip to content

Commit

Permalink
Add Phoenix6 logging
Browse files Browse the repository at this point in the history
Added Phoenix6 CAN frame logging for extra diagnostics.

Fixed issue with having two NT4 publishers to AdvantageKit.
  • Loading branch information
garrettsummerfi3ld committed Mar 2, 2024
1 parent c0f9231 commit 3c1f347
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import org.littletonrobotics.junction.wpilog.WPILOGWriter;
import org.littletonrobotics.urcl.URCL;

import com.ctre.phoenix6.SignalLogger;

/**
* The VM is configured to automatically run this class, and to call the functions corresponding to
* each mode, as described in the TimedRobot documentation. If you change the name of this class or
Expand Down Expand Up @@ -91,14 +93,14 @@ public void robotInit() {
if (Paths.get("/U").getParent() != null) {
Logger.addDataReceiver(new WPILOGWriter());
noLog.set(true);
SignalLogger.start();
} else {
setUseTiming(false);
try {
String logPath = LogFileUtil.findReplayLog();
Logger.setReplaySource(new WPILOGReader(logPath));
} catch (Exception e) {
e.printStackTrace();
Logger.addDataReceiver(new NT4Publisher());
}
}
}
Expand Down

0 comments on commit 3c1f347

Please sign in to comment.