Class TelemetryHelper

java.lang.Object
com.crossbotics.ftchelper.telemetry.TelemetryHelper

public final class TelemetryHelper extends Object
Shortcuts for clear, same-every-time Driver Station telemetry.

 TelemetryHelper.section(telemetry, "Lift");
 TelemetryHelper.motor(telemetry, "Lift", liftMotor);
 TelemetryHelper.value(telemetry, "Target", liftTarget, "ticks");
 TelemetryHelper.flag(telemetry, "At bottom", lift.isAtLower());
 telemetry.update();
 

Shows on the Driver Station like this:

 --- Lift ---
 Lift : pwr 0.45 | pos 1203 | vel 812/s
 Target : 1500 ticks
 At bottom : no
 

For driver and debug levels and warnings on top, see RobotTelemetry. Docs: docs/modules/telemetry.md

  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    flag(org.firstinspires.ftc.robotcore.external.Telemetry telemetry, String label, boolean value)
    Adds "label : yes" or "label : no".
    static void
    motor(org.firstinspires.ftc.robotcore.external.Telemetry telemetry, String label, com.qualcomm.robotcore.hardware.DcMotorEx motor)
    Adds a motor's power, encoder position and speed (counts per second) on one line.
    static String
    num(double value, int decimals)
    Formats a number with a fixed number of decimals, e.g.
    static void
    section(org.firstinspires.ftc.robotcore.external.Telemetry telemetry, String title)
    Adds a heading line, to split the screen into groups.
    static void
    servo(org.firstinspires.ftc.robotcore.external.Telemetry telemetry, String label, com.qualcomm.robotcore.hardware.Servo servo)
    Adds a servo's last commanded position (servos cannot report where they really are).
    static void
    value(org.firstinspires.ftc.robotcore.external.Telemetry telemetry, String label, double value, int decimals)
    Adds "label : value", with the number of decimals you choose.
    static void
    value(org.firstinspires.ftc.robotcore.external.Telemetry telemetry, String label, double value, String unit)
    Adds "label : value unit", with 2 decimals.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • section

      public static void section(org.firstinspires.ftc.robotcore.external.Telemetry telemetry, String title)
      Adds a heading line, to split the screen into groups.
    • value

      public static void value(org.firstinspires.ftc.robotcore.external.Telemetry telemetry, String label, double value, String unit)
      Adds "label : value unit", with 2 decimals.
      Parameters:
      unit - the unit to show after the number, e.g. "ticks" or "in"
    • value

      public static void value(org.firstinspires.ftc.robotcore.external.Telemetry telemetry, String label, double value, int decimals)
      Adds "label : value", with the number of decimals you choose.
      Parameters:
      decimals - how many digits after the decimal point (0 or more)
    • flag

      public static void flag(org.firstinspires.ftc.robotcore.external.Telemetry telemetry, String label, boolean value)
      Adds "label : yes" or "label : no".
    • motor

      public static void motor(org.firstinspires.ftc.robotcore.external.Telemetry telemetry, String label, com.qualcomm.robotcore.hardware.DcMotorEx motor)
      Adds a motor's power, encoder position and speed (counts per second) on one line. Power is -1 to 1; position and speed are in encoder ticks (counts).
    • servo

      public static void servo(org.firstinspires.ftc.robotcore.external.Telemetry telemetry, String label, com.qualcomm.robotcore.hardware.Servo servo)
      Adds a servo's last commanded position (servos cannot report where they really are).
    • num

      public static String num(double value, int decimals)
      Formats a number with a fixed number of decimals, e.g. num(0.4567, 2) gives "0.46". NaN shows as "--" (for example "no target").
      Parameters:
      value - the number
      decimals - digits after the decimal point; below 0 counts as 0
      Returns:
      the number as text