Annotations: WPILib Logging
Use WPILib’s annotation-based telemetry to auto-publish robot state with minimal code.
Enable Annotations (Java)
1) Add @Logged to your Robot class and any subsystems you want to publish.
2) Call the logger binding in your robot constructor to start publishing.
3) (Optional) Start DataLogManager to also save a .wpilog file on the robot.
import edu.wpi.first.util.datalog.DataLogManager;
import edu.wpi.first.wpilibj2.command.CommandScheduler;
import edu.wpi.first.wpilibj.RobotBase;
// 1) Annotate classes
@Logged
public class Robot extends TimedRobot {
private final ArmSubsystem arm = new ArmSubsystem();
private final ElevatorSubsystem elevator = new ElevatorSubsystem();
public Robot() {
// 2) Bind the logger to the robot (annotations take effect)
org.littletonrobotics.junction.Logger.configureBindings(this); // or use the WPILib annotations bind call when available
// 3) Optional on-robot recording
DataLogManager.start(); // saves .wpilog files for later review
}
}
See the official docs for the 2025 Robot Telemetry with Annotations feature for exact API calls and usage details. We mirror that flow in Ironclad’s codebase.
What gets logged?
- Public fields and bean-style getters on
@Loggedclasses - Types supported by WPILib’s logging system (numbers/booleans/strings, structs like
Pose2d, arrays, etc.)
Tips
- Keep namespacing consistent (e.g.,
Arm/Angle,Elevator/Setpoint). - Use
@Logrename/format options (when available) to control topic names. - Pair with AdvantageScope for live plots and field widgets.