From 293773c66d20bc4cad0e5f24a7e036895d425be2 Mon Sep 17 00:00:00 2001 From: Alex Schokking Date: Thu, 14 May 2026 19:22:33 -0700 Subject: [PATCH 1/2] Disable network table writing of akit logs when on a real field --- src/main/java/xbot/common/command/BaseRobot.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/xbot/common/command/BaseRobot.java b/src/main/java/xbot/common/command/BaseRobot.java index 49c5eb8b..13fea48a 100644 --- a/src/main/java/xbot/common/command/BaseRobot.java +++ b/src/main/java/xbot/common/command/BaseRobot.java @@ -98,7 +98,12 @@ public void robotInit() { if (logDirectory.exists() && logDirectory.isDirectory() && logDirectory.canWrite()) { Logger.addDataReceiver(new WPILOGWriter("/U/logs")); // Log to a USB stick with label LOGSDRIVE plugged into the inner usb port } - Logger.addDataReceiver(new NT4Publisher()); // Publish data to NetworkTables + + if (!DriverStation.isFMSAttached()) { + // Publish data to NetworkTables if we're not on a real field + Logger.addDataReceiver(new NT4Publisher()); + } + LoggedPowerDistribution.getInstance( PowerDistribution.kDefaultModule, PowerDistribution.ModuleType.kRev); // Log power distribution data from the configured module From 3b8487064875eab22b8b5390ee0e6e6c0a45069b Mon Sep 17 00:00:00 2001 From: Alex Schokking Date: Thu, 21 May 2026 18:37:50 -0700 Subject: [PATCH 2/2] Add explicit logging to NT of current auto command --- .../subsystems/autonomous/AutonomousCommandSelector.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/xbot/common/subsystems/autonomous/AutonomousCommandSelector.java b/src/main/java/xbot/common/subsystems/autonomous/AutonomousCommandSelector.java index 47fc33a8..98d9fb6f 100644 --- a/src/main/java/xbot/common/subsystems/autonomous/AutonomousCommandSelector.java +++ b/src/main/java/xbot/common/subsystems/autonomous/AutonomousCommandSelector.java @@ -7,6 +7,7 @@ import javax.inject.Singleton; import edu.wpi.first.math.geometry.Pose2d; +import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj2.command.InstantCommand; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -51,8 +52,11 @@ public void setCurrentAutonomousStartingPosition(Pose2d position){ public void setCurrentAutonomousCommand(Command currentAutonomousCommand) { log.info("Setting CurrentAutonomousCommand to " + currentAutonomousCommand); log.info("Setting CurrentStartingPosition to " + currentAutonomousStartingPosition); - aKitLog.record("Current autonomous command name", - currentAutonomousCommand == null ? "No command set" : currentAutonomousCommand.getName()); + var nameString = currentAutonomousCommand == null ? "No command set" : currentAutonomousCommand.getName(); + aKitLog.record("Current autonomous command name", nameString); + + // to make sure this is always logged to networktables no matter what, also explicitly push it to the SD + SmartDashboard.putString("Current autunomous command name", nameString); this.currentAutonomousCommand = currentAutonomousCommand; commandSupplier = null;