Package frc.spectrumLib.telemetry
Class Telemetry
java.lang.Object
dev.doglog.DogLog
frc.spectrumLib.telemetry.Telemetry
- All Implemented Interfaces:
Subsystem
Telemetry and logging utility. Extends DogLog to provide structured logging and console output
with priority levels.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumNamed fault conditions that can be surfaced as structured log entries.static enumPriority levels for printing to the console. -
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a Telemetry instance and registers it as a WPILib subsystem so itsperiodic()method is called every loop cycle. -
Method Summary
Modifier and TypeMethodDescriptionstatic CommandWraps a command so that its initialization and end are logged to the "Commands" key.static voidReads all active alerts from the SmartDashboard NetworkTable and logs any that are new since the last call under the "Alerts" DogLog key.voidperiodic()Called every robot loop cycle.static voidPrints a message atTelemetry.PrintPriority.NORMALpriority.static voidprint(String output, Telemetry.PrintPriority priority) Print a statement if they are enabledstatic voidstart(boolean ntPublish, boolean captureDs, boolean captureNt, boolean captureConsole, boolean logExtras, boolean tunableOnFMS, Telemetry.PrintPriority priority) Start the telemetry system.Methods inherited from class dev.doglog.DogLog
clearFault, clearFault, decreaseFault, decreaseFault, faultsActive, faultsLogged, getOptions, isEnabled, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, log, logFault, logFault, logFault, setEnabled, setOptions, setPdh, time, time, timeEnd, timestamp, tunable, tunable, tunable, tunable, tunable, tunable, tunable, tunable, tunable, tunable, tunable, tunable, tunable, tunable, tunable, tunable, tunable, tunable, tunable, tunable, tunable, tunable, tunable, tunable, tunable, tunable, tunable, tunable, tunable, tunableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface edu.wpi.first.wpilibj2.command.Subsystem
defer, getCurrentCommand, getDefaultCommand, getName, idle, register, removeDefaultCommand, run, runEnd, runOnce, setDefaultCommand, simulationPeriodic, startEnd, startRun
-
Constructor Details
-
Telemetry
public Telemetry()Creates a Telemetry instance and registers it as a WPILib subsystem so itsperiodic()method is called every loop cycle.
-
-
Method Details
-
periodic
public void periodic()Called every robot loop cycle. Logs any newly active alerts from NetworkTables. -
start
public static void start(boolean ntPublish, boolean captureDs, boolean captureNt, boolean captureConsole, boolean logExtras, boolean tunableOnFMS, Telemetry.PrintPriority priority) Start the telemetry system.- Parameters:
ntPublish- Whether to publish to NetworkTables.captureNt- Whether to capture NetworkTables entries in the log.captureDs- Whether to capture SmartDashboard entries in the log.captureConsole- Whether to capture console output in the log.logExtras- Whether to log extra data, like PDH currents, CAN usage, radio connection status, etc.tunableOnFMS- Whether tunable values should be read from NetworkTables.priority- The minimum priority level for console output.
-
log
Wraps a command so that its initialization and end are logged to the "Commands" key.- Parameters:
cmd- The command to wrap- Returns:
- a decorated command that logs lifecycle events and preserves the original name
-
print
Print a statement if they are enabled -
print
Prints a message atTelemetry.PrintPriority.NORMALpriority. The message is always written to the DogLog "Prints" key but only echoed to stdout when the global priority allows it.- Parameters:
output- The string to print
-
logAlerts
public static void logAlerts()Reads all active alerts from the SmartDashboard NetworkTable and logs any that are new since the last call under the "Alerts" DogLog key.
-