diff --git a/build.gradle b/build.gradle index 8cf4665a..96b40192 100644 --- a/build.gradle +++ b/build.gradle @@ -47,25 +47,6 @@ wpi.java.debugJni = false // Set this to true to enable desktop support. def includeDesktopSupport = true - -repositories { - maven { - url = uri("https://maven.pkg.github.com/Mechanical-Advantage/AdvantageKit") - credentials { - username = "Mechanical-Advantage-Bot" - password = "\u0067\u0068\u0070\u005f\u006e\u0056\u0051\u006a\u0055\u004f\u004c\u0061\u0079\u0066\u006e\u0078\u006e\u0037\u0051\u0049\u0054\u0042\u0032\u004c\u004a\u006d\u0055\u0070\u0073\u0031\u006d\u0037\u004c\u005a\u0030\u0076\u0062\u0070\u0063\u0051" - } - } - mavenLocal() -} - -task(replayWatch, type: JavaExec) { - mainClass = "org.littletonrobotics.junction.ReplayWatch" - classpath = sourceSets.main.runtimeClasspath -} - - - // Defining my dependencies. In this case, WPILib (+ friends), and vendor libraries. // Also defines JUnit 5. dependencies { @@ -89,9 +70,6 @@ dependencies { testImplementation 'org.junit.jupiter:junit-jupiter:5.10.1' testRuntimeOnly 'org.junit.platform:junit-platform-launcher' - - def akitJson = new groovy.json.JsonSlurper().parseText(new File(projectDir.getAbsolutePath() + "/vendordeps/AdvantageKit.json").text) - annotationProcessor "org.littletonrobotics.akit:akit-autolog:$akitJson.version" } test { diff --git a/src/main/java/frc/robot/Robot.java b/src/main/java/frc/robot/Robot.java index a8f7cabe..633c0f6e 100644 --- a/src/main/java/frc/robot/Robot.java +++ b/src/main/java/frc/robot/Robot.java @@ -4,21 +4,13 @@ package frc.robot; - -import org.littletonrobotics.junction.LogFileUtil; -import org.littletonrobotics.junction.LoggedRobot; -import org.littletonrobotics.junction.Logger; -import org.littletonrobotics.junction.networktables.NT4Publisher; -import org.littletonrobotics.junction.wpilog.WPILOGReader; -import org.littletonrobotics.junction.wpilog.WPILOGWriter; - -import edu.wpi.first.wpilibj.PowerDistribution; -import edu.wpi.first.wpilibj.PowerDistribution.ModuleType; +import dev.doglog.DogLog; +import dev.doglog.DogLogOptions; import edu.wpi.first.wpilibj.TimedRobot; import edu.wpi.first.wpilibj2.command.Command; import edu.wpi.first.wpilibj2.command.CommandScheduler; -public class Robot extends LoggedRobot { +public class Robot extends TimedRobot { private Command m_autonomousCommand; private final RobotContainer m_robotContainer; @@ -26,20 +18,7 @@ public class Robot extends LoggedRobot { public Robot() { m_robotContainer = new RobotContainer(); - Logger.recordMetadata("ProjectName", "JavaBot-2025"); // Set a metadata value - - if (isReal()) { - Logger.addDataReceiver(new WPILOGWriter()); // Log to a USB stick ("/U/logs") - Logger.addDataReceiver(new NT4Publisher()); // Publish data to NetworkTables - PowerDistribution distribution = new PowerDistribution(1, ModuleType.kRev); // Enables power distribution logging - } else { - setUseTiming(false); // Run as fast as possible - String logPath = LogFileUtil.findReplayLog(); // Pull the replay log from AdvantageScope (or prompt the user) - Logger.setReplaySource(new WPILOGReader(logPath)); // Read replay log - Logger.addDataReceiver(new WPILOGWriter(LogFileUtil.addPathSuffix(logPath, "_sim"))); // Save outputs to a new log - } - - Logger.start(); // Start logging! No more data receivers, replay sources, or metadata values may be added. + DogLog.setOptions(new DogLogOptions().withNtPublish(true)); } diff --git a/src/main/java/frc/robot/subsystems/CommandSwerveDrivetrain.java b/src/main/java/frc/robot/subsystems/CommandSwerveDrivetrain.java index 2fa6c5e3..1209e670 100644 --- a/src/main/java/frc/robot/subsystems/CommandSwerveDrivetrain.java +++ b/src/main/java/frc/robot/subsystems/CommandSwerveDrivetrain.java @@ -6,8 +6,6 @@ import java.util.Optional; import java.util.function.Supplier; -import org.littletonrobotics.junction.Logger; - import com.ctre.phoenix6.SignalLogger; import com.ctre.phoenix6.Utils; import com.ctre.phoenix6.mechanisms.swerve.LegacySwerveRequest; @@ -24,6 +22,8 @@ import com.pathplanner.lib.util.DriveFeedforwards; import com.pathplanner.lib.util.swerve.SwerveSetpoint; import com.pathplanner.lib.util.swerve.SwerveSetpointGenerator; + +import dev.doglog.DogLog; import edu.wpi.first.math.Matrix; import edu.wpi.first.math.filter.SlewRateLimiter; import edu.wpi.first.math.geometry.Pose2d; @@ -343,7 +343,6 @@ public Command sysIdDynamic(SysIdRoutine.Direction direction) { @Override public void periodic() { - /* * Periodically try to apply the operator perspective. * If we haven't applied the operator perspective before, then we should apply it regardless of DS state. @@ -362,8 +361,8 @@ public void periodic() { }); } - Logger.recordOutput("Drive/desiredChassisSpeeds", m_applyFieldSpeedsOrbit.getChassisSpeeds()); - Logger.recordOutput("Drive/setpointChassisSpeeds", m_applyFieldSpeedsOrbit.getPreviousSetpoint().robotRelativeSpeeds()); + DogLog.log("/Drive/desiredChassisSpeeds", m_applyFieldSpeedsOrbit.getChassisSpeeds()); + DogLog.log("/Drive/setpointChassisSpeeds", m_applyFieldSpeedsOrbit.getPreviousSetpoint().robotRelativeSpeeds()); } private void startSimThread() { diff --git a/vendordeps/AdvantageKit.json b/vendordeps/AdvantageKit.json deleted file mode 100644 index a0fd18c2..00000000 --- a/vendordeps/AdvantageKit.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "fileName": "AdvantageKit.json", - "name": "AdvantageKit", - "version": "4.0.0-beta-1", - "uuid": "d820cc26-74e3-11ec-90d6-0242ac120003", - "frcYear": "2025", - "mavenUrls": [], - "jsonUrl": "https://github.com/Mechanical-Advantage/AdvantageKit/releases/latest/download/AdvantageKit.json", - "javaDependencies": [ - { - "groupId": "org.littletonrobotics.akit", - "artifactId": "akit-java", - "version": "4.0.0-beta-1" - } - ], - "jniDependencies": [ - { - "groupId": "org.littletonrobotics.akit", - "artifactId": "akit-wpilibio", - "version": "4.0.0-beta-1", - "skipInvalidPlatforms": false, - "isJar": false, - "validPlatforms": [ - "linuxathena", - "windowsx86-64", - "linuxx86-64", - "osxuniversal" - ] - } - ], - "cppDependencies": [] -} \ No newline at end of file diff --git a/vendordeps/DogLog-2025.0.0.json b/vendordeps/DogLog-2025.0.0.json new file mode 100644 index 00000000..a4ce6ad5 --- /dev/null +++ b/vendordeps/DogLog-2025.0.0.json @@ -0,0 +1,20 @@ +{ + "javaDependencies": [ + { + "groupId": "com.github.jonahsnider", + "artifactId": "doglog", + "version": "2025.0.0" + } + ], + "fileName": "DogLog-2025.0.0.json", + "frcYear": "2025", + "jsonUrl": "https://doglog.dev/vendordep.json", + "name": "DogLog", + "jniDependencies": [], + "mavenUrls": [ + "https://jitpack.io" + ], + "cppDependencies": [], + "version": "2025.0.0", + "uuid": "65592ce1-2251-4a31-8e4b-2df20dacebe4" +} \ No newline at end of file