Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/main/java/xbot/common/command/BaseRobot.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down