Skip to content
learnFRC.org
programminglesson35 min

Telemetry Logging & AdvantageScope

WPILib DataLogManager, Epilogue annotation telemetry, AdvantageScope 3D visualization, post-match data analysis, and diagnostic troubleshooting.

What you will learn

  • Enable low-overhead binary flight-recorder logging with DataLogManager.
  • Apply declarative telemetry using the WPILib Epilogue annotation processor (@Logged).
  • Record CAN bus signals, power distribution logs, and driver inputs.
  • Diagnose match brownouts and mechanism faults using AdvantageScope log viewer.

Prerequisites:State Machines & Mechanism Interlocks

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.


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;
@Logged
public 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);
}
}
  • 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/.
Use a USB Flash Drive

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;
@Logged
public 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;
}
}
  1. Zero Runtime Reflection: Code is generated during ./gradlew build via an annotation processor, eliminating reflection performance penalties.
  2. Deterministic Hierarchical Namespaces: Subsystems, nested objects, and getters are mapped automatically to standard NetworkTables 4 schemas matching the class structure.
  3. Selective Exclusions: Use @NotLogged on hardware controller references, buffers, or secret tokens to prevent unnecessary network traffic.

AdvantageScope is an open-source FRC telemetry visualizer bundled with the WPILib installer.

  1. Connect your laptop to the robot via Ethernet or USB-B tether.
  2. Open AdvantageScope.
  3. Select File -> Download Logs over SSH.
  4. Enter team number XXXX and click Download. AdvantageScope will list all match logs stored on the roboRIO.

  • Shows all four swerve modules rotating and driving in real time.
  • Verifies whether module azimuth angles tracked correctly during autonomous.
  • 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.
  • 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.

Make this routine standard protocol between qualification matches:

  1. Open the latest .wpilog in AdvantageScope.
  2. Check Battery Voltage: Did voltage stay above 8.0V during full-throttle acceleration?
  3. Check CAN Bus Health: Were there any CAN frame drops or bus-off errors?
  4. Check Mechanism Currents: Did any mechanism pull continuous current (> 35A) while holding position?
  5. Check Loop Cycle Times: Did loop timing remain steady at 20 milliseconds without spikes over 40 ms?

  • 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.
  • 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.

  1. Run simulation (F5) and drive around for 30 seconds.
  2. Stop simulation and look in your project’s logs/ directory.
  3. Open the generated .wpilog file in AdvantageScope.
  4. Drag SmartDashboard/Arm/AngleDeg or your Epilogue logged fields into a line graph tab and observe the smooth trajectory curves.

Verified Sources & Standards

Evergreen Standard Verified: Sep 25, 2026