Telemetry: Recording and Sending Real-Time Data
Recording and viewing telemetry data is a crucial part of the engineering process - accurate telemetry data helps you tune your robot to perform optimally, and is indispensable for debugging your robot when it fails to perform as expected.
By default, no telemetry data is recorded (saved) on the robot. However, recording data on the robot can provide benefits over recording on a dashboard, namely that more data can be recorded (there are no bandwidth limitations), and all the recorded data can be very accurately timestamped. WPILib has integrated support for on-robot recording of telemetry data via the DataLogManager
and DataLog
classes and provides a tool for downloading data log files and converting them to CSV.
Note
In addition to on-robot recording of telemetry data, teams can record their telemetry data on their driver station computer with Shuffleboard recordings.
Adding Telemetry to Robot Code
WPILib supports several different ways to record and send telemetry data from robot code.
Au niveau le plus élémentaire, le Riolog gère l’affichage des instructions d’impression en provenance du code du robot. Cette fonctionnalité est utile pour le débogage à la volée d’un code présentant des erreurs, mais ne permet pas la mise à l’échelle car les interfaces de console ne conviennent pas aux flux importants de données.
WPILib prend en charge plusieurs dashboards qui permettent aux utilisateurs d’envoyer plus facilement de nombreuses données de télémesure vers l’ordinateur de pilotage. Tous les dashboards de la WPILib communiquent par l’intermédiare du protocole NetworkTables, et ils sont donc dans une certaine mesure interopérables (les données de télémesure enregistrée avec un dashboard seront visibles sur les autres, mais les widgets/formatages spécifiques ne seront généralement pas compatibles). NetworkTables (et donc tous les dashboards de la WPILib) prennent actuellement en charge les types de données suivants :
boolean
boolean[]
double
double[]
string
string[]
byte[]
Telemetry data can be sent to a WPILib dashboard using an associated WPILib method (for more details, see the documentation for the individual dashboard in question), or by directly publishing to NetworkTables.
While NetworkTables does not yet support serialization of complex data types (this is tentatively scheduled for 2024), mutable types from user code can be easily extended to interface directly with WPILib dashboards via the Sendable
interface, whose usage is described in the next article.