Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 1.07 KB

METADATA.md

File metadata and controls

26 lines (18 loc) · 1.07 KB

🔍 Metadata

< Return to homepage

The metadata tab shows values published to the hidden "/Metadata" table or through AdvantageKit. The metadata keys are displayed to the left, and the columns separate data from different sources (e.g. real and replay when using AdvantageKit).

Overview of metadata tab

The example code below shows how to log metadata using WPILib. The values must be logged to the "/Metadata" table as strings.

// NetworkTables (also saved to DataLog by default)
StringPublisher publisher = NetworkTableInstance.getDefault()
    .getStringTopic("/Metadata/MyKey").publish();
publisher.set("MyValue");

// DataLog (not published to NetworkTables)
StringLogEntry entry = new StringLogEntry(DataLogManager.getLog(), "/Metadata/MyKey");
entry.append("MyValue");

To save metadata using AdvantageKit, call the method below before starting the logger. Metadata is stored separately when running in real and replay for easy comparison.

Logger.getInstance().recordMetadata("MyKey", "MyValue");