Skip to content

Commit

Permalink
Add URCL, PDH logging
Browse files Browse the repository at this point in the history
Since REV does not provide an official method of automatically recording data from the Spark Max and Spark Flex, we have provided an unofficial alternative for Java and C++ called URCL (Unofficial REV-Compatible Logger). This enables live plotting and logging of all devices similar to CTRE's Tuner X plotting feature and Phoenix 6 signal logger.

Power Distribution Hub is also now logged in AdvantageKit.
  • Loading branch information
garrettsummerfi3ld committed Feb 14, 2024
1 parent 18ecb74 commit 3d0d81d
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.littletonrobotics.junction.networktables.NT4Publisher;
import org.littletonrobotics.junction.wpilog.WPILOGReader;
import org.littletonrobotics.junction.wpilog.WPILOGWriter;
import org.littletonrobotics.urcl.URCL;
import swervelib.parser.SwerveParser;

/**
Expand Down Expand Up @@ -55,8 +56,13 @@ public void robotInit() {

if (isReal()) {
Logger.addDataReceiver(new NT4Publisher()); // Publish data to NetworkTables
new PowerDistribution(
HardwareConstants.REV_PDH_ID, ModuleType.kRev); // Enables power distribution logging
PowerDistribution pdh =
new PowerDistribution(
HardwareConstants.REV_PDH_ID, ModuleType.kRev); // Enables power distribution logging
pdh.setSwitchableChannel(true);
pdh.close();
Logger.registerURCL(URCL.startExternal());

} else {
setUseTiming(false); // Run as fast as possible
String logPath =
Expand Down
65 changes: 65 additions & 0 deletions vendordeps/URCL.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"fileName": "URCL.json",
"name": "URCL",
"version": "2024.0.1",
"frcYear": "2024",
"uuid": "84246d17-a797-4d1e-bd9f-c59cd8d2477c",
"mavenUrls": [
"https://raw.githubusercontent.com/Mechanical-Advantage/URCL/2024.0.1"
],
"jsonUrl": "https://raw.githubusercontent.com/Mechanical-Advantage/URCL/maven/URCL.json",
"javaDependencies": [
{
"groupId": "org.littletonrobotics.urcl",
"artifactId": "URCL-java",
"version": "2024.0.1"
}
],
"jniDependencies": [
{
"groupId": "org.littletonrobotics.urcl",
"artifactId": "URCL-driver",
"version": "2024.0.1",
"skipInvalidPlatforms": true,
"isJar": false,
"validPlatforms": [
"windowsx86-64",
"linuxx86-64",
"linuxathena",
"osxuniversal"
]
}
],
"cppDependencies": [
{
"groupId": "org.littletonrobotics.urcl",
"artifactId": "URCL-cpp",
"version": "2024.0.1",
"libName": "URCL",
"headerClassifier": "headers",
"sharedLibrary": false,
"skipInvalidPlatforms": true,
"binaryPlatforms": [
"windowsx86-64",
"linuxx86-64",
"linuxathena",
"osxuniversal"
]
},
{
"groupId": "org.littletonrobotics.urcl",
"artifactId": "URCL-driver",
"version": "2024.0.1",
"libName": "URCLDriver",
"headerClassifier": "headers",
"sharedLibrary": false,
"skipInvalidPlatforms": true,
"binaryPlatforms": [
"windowsx86-64",
"linuxx86-64",
"linuxathena",
"osxuniversal"
]
}
]
}

0 comments on commit 3d0d81d

Please sign in to comment.