Using Telemetry - Dutton-Christian-Robotics/Learning-to-Code GitHub Wiki

The FTC telemetry system allows specific information to be displayed on the driver station app. In addition to helping provide useful information to the actual drive team, this is one of the main ways of debugging problems in OpModes.

Simple Telemetry

The simplest way to use telemetry is to provide the telemetry one or more pieces of information to be displayed and to then to "update" the telemetry. The code would look something like this:

telemetry.addData("count", currentCount);

The telemetry object is provided by the OpMode class and is ready to use. Note that to update telemetry from a robot class, the telemetry object should be passed to the robot class itself.

The first argument to the addData call is a string for how the information should be labeled in the driver station app. The second argument is the actual value to be displayed—such as from a variable. For the information to show up on the driver station app, an "update" call must be made:

telemetry.update();

Technically speaking, the update method call is only required if your opmode subclasses LinearOpMode. If you're extending the more basic OpMode, the update call is automatically made at the end of init_loop() and loop()

The default behavior is to have all telemetry items automatically erased when calling update(). That means making sure your code always includes enough addData() calls to display desired telemetry. To disable auto-erasing, call telemetry.setAutoClear(false);

Complex Telemetry

The telemetry object has additional functionality, such as logging simple text lines and updating telemetry data through separate Telemetry.Item objects. See these javadoc pages on the FTC API for more information