Class TelemetryManager

java.lang.Object
com.cdarobotics.cdalib.telemetry.TelemetryManager

public class TelemetryManager extends Object
Manages a set of telemetry entries and controls which are pushed to the driver station. Entries are grouped by tag; only entries whose tag is in the active display set (see setDisplayTags(String...)) are shown when displayTelemetry() is called.
  • Constructor Details

    • TelemetryManager

      public TelemetryManager(org.firstinspires.ftc.robotcore.external.Telemetry telemetry)
      Creates a manager that writes to the given telemetry backend.
      Parameters:
      telemetry - the OpMode telemetry to render entries to.
  • Method Details

    • addEntry

      public void addEntry(Entry entry)
      Registers an existing entry.
    • addEntry

      public void addEntry(String tag, String label, Supplier<String> supplier)
      Builds and registers an entry with an explicit group tag.
      Parameters:
      tag - the group tag for the entry.
      label - the label shown for the entry.
      supplier - supplies the entry's current value on each display.
    • addEntry

      public void addEntry(String label, Supplier<String> supplier)
      Builds and registers an entry in the "default" group.
      Parameters:
      label - the label shown for the entry.
      supplier - supplies the entry's current value on each display.
    • setDisplayTags

      public void setDisplayTags(String... tags)
      Adds the given tags to the set of groups shown by displayTelemetry().
    • removeDisplayTags

      public void removeDisplayTags(String... tags)
      Removes the given tags from the set of groups shown by displayTelemetry().
    • displayTelemetry

      public void displayTelemetry()
      Renders every registered entry whose tag is in the active display set, then pushes the batch to the driver station. Values are re-fetched from each entry's supplier as they are rendered.