When a robot loses communication or browns out on the competition field, spectator videos and driver impressions cannot tell you which motor drew excessive current or what error code was thrown.
AdvantageScope, WPILib DataLogManager, and the WPILib Epilogue annotation system record thousands of signals every 20ms to a binary log file (.wpilog) for deterministic post-match flight recorder analysis.
1. Setting Up DataLogManager
Section titled “1. Setting Up DataLogManager”Enabling high-speed binary logging in WPILib requires adding standard initialization calls to Robot.java:
package frc.robot;
import edu.wpi.first.wpilibj.TimedRobot;import edu.wpi.first.wpilibj.DataLogManager;import edu.wpi.first.wpilibj.DriverStation;import edu.wpi.first.epilogue.Epilogue;import edu.wpi.first.epilogue.Logged;
@Loggedpublic class Robot extends TimedRobot { @Override public void robotInit() { // Starts recording all NetworkTables changes to /u/logs/*.wpilog DataLogManager.start();
// Logs Driver Station joystick inputs, match time, and alliance state DriverStation.startDataLog(DataLogManager.getLog());
// Binds Epilogue annotation processor for automated data logging Epilogue.bind(this); }
@Override public void robotPeriodic() { // Runs generated telemetry updates every 20ms Epilogue.update(this); }}Where Logs are Stored:
Section titled “Where Logs are Stored:”- With USB Flash Drive plugged into roboRIO: Saved to
/u/logs/. Logs persist across robot reboots. - Without USB Flash Drive: Saved to the roboRIO internal flash memory at
/home/lvuser/logs/. - In Simulation: Saved to your local project directory under
logs/.
Always plug an 8GB or 16GB USB flash drive into one of the roboRIO USB host ports. Writing logs to the flash drive protects the roboRIO internal flash memory and lets the pit crew pull the drive directly for analysis.
2. Declarative Telemetry with WPILib Epilogue (@Logged)
Section titled “2. Declarative Telemetry with WPILib Epilogue (@Logged)”In past seasons, logging mechanism state required writing repetitive SmartDashboard.putNumber(...) lines inside every subsystem’s periodic() method. This introduced runtime String allocation overhead and caused missing telemetry when developers forgot to publish new variables.
WPILib Epilogue replaces manual string-keyed publishing with compile-time code generation:
package frc.robot.subsystems;
import edu.wpi.first.wpilibj2.command.SubsystemBase;import edu.wpi.first.epilogue.Logged;import edu.wpi.first.epilogue.NotLogged;import com.ctre.phoenix6.hardware.TalonFX;
@Loggedpublic class ElevatorSubsystem extends SubsystemBase { // Automatically published to NetworkTables under /Robot/ElevatorSubsystem/currentHeightMeters: private double currentHeightMeters = 0.0;
// Automatically published: private boolean atUpperLimit = false;
// Excluded from logging using @NotLogged: @NotLogged private final TalonFX m_leaderMotor = new TalonFX(10, "rio");
public double getHeight() { return currentHeightMeters; }}Epilogue Key Advantages:
Section titled “Epilogue Key Advantages:”- Zero Runtime Reflection: Code is generated during
./gradlew buildvia an annotation processor, eliminating reflection performance penalties. - Deterministic Hierarchical Namespaces: Subsystems, nested objects, and getters are mapped automatically to standard NetworkTables 4 schemas matching the class structure.
- Selective Exclusions: Use
@NotLoggedon hardware controller references, buffers, or secret tokens to prevent unnecessary network traffic.
3. Navigating AdvantageScope
Section titled “3. Navigating AdvantageScope”AdvantageScope is an open-source FRC telemetry visualizer bundled with the WPILib installer.
Downloading Logs in the Pit:
Section titled “Downloading Logs in the Pit:”- Connect your laptop to the robot via Ethernet or USB-B tether.
- Open AdvantageScope.
- Select File -> Download Logs over SSH.
- Enter team number
XXXXand click Download. AdvantageScope will list all match logs stored on the roboRIO.
4. Four Essential Diagnostic Views
Section titled “4. Four Essential Diagnostic Views”1. 3D Swerve Drivetrain View
Section titled “1. 3D Swerve Drivetrain View”- Shows all four swerve modules rotating and driving in real time.
- Verifies whether module azimuth angles tracked correctly during autonomous.
2. 2D Field Trajectory Overlay
Section titled “2. 2D Field Trajectory Overlay”- Displays the robot’s estimated field pose (
SwerveDrivePoseEstimator) moving across the official field layout. - Compare actual robot path against planned PathPlanner paths to see where wheel slip or defense pushed the robot off course.
3. Mechanism2d Animated Replay
Section titled “3. Mechanism2d Animated Replay”- Displays animated 2D vectors for elevators, arms, and wrists.
- Verify whether the arm reached its setpoint before the feeder fired.
4. Line Graphs: Motor Current & Battery Voltage
Section titled “4. Line Graphs: Motor Current & Battery Voltage”- Plot Battery Voltage alongside Mechanism Stator Currents.
- The Brownout Signature: If battery voltage dips below 7.5V while a motor draws 60A, you have found mechanical binding or an aging battery that must be retired.
5. The 5-Minute Pit Diagnostic Routine
Section titled “5. The 5-Minute Pit Diagnostic Routine”Make this routine standard protocol between qualification matches:
- Open the latest
.wpilogin AdvantageScope. - Check Battery Voltage: Did voltage stay above 8.0V during full-throttle acceleration?
- Check CAN Bus Health: Were there any CAN frame drops or bus-off errors?
- Check Mechanism Currents: Did any mechanism pull continuous current (> 35A) while holding position?
- Check Loop Cycle Times: Did loop timing remain steady at 20 milliseconds without spikes over 40 ms?
Common Failure Modes
Section titled “Common Failure Modes”1. No Logs Recorded on USB Drive
Section titled “1. No Logs Recorded on USB Drive”- Symptom: The USB drive is plugged in, but the
/u/logs/folder is empty. - Cause: USB flash drive is formatted with exFAT or APFS, which the Linux roboRIO kernel cannot mount.
- Fix: Format the USB drive as FAT32 or NTFS on your computer.
2. File Size Exceeds 100 MB per Match
Section titled “2. File Size Exceeds 100 MB per Match”- Symptom: Log files fill up the drive rapidly.
- Cause: Logging large raw camera frames or high-frequency string messages every 20ms.
- Fix: Log numerical doubles, booleans, and arrays; avoid streaming raw camera image bytes over NetworkTables.
Check Your Work
Section titled “Check Your Work”- Run simulation (F5) and drive around for 30 seconds.
- Stop simulation and look in your project’s
logs/directory. - Open the generated
.wpilogfile in AdvantageScope. - Drag
SmartDashboard/Arm/AngleDegor your Epilogue logged fields into a line graph tab and observe the smooth trajectory curves.
Verified Sources & Standards
- WPILib DataLogManager & AdvantageScope Telemetrydocs.wpilib.orgWPILib Standard
- WPILib Robot Telemetry with Annotations (Epilogue)docs.wpilib.orgWPILib Standard