AGHSEagleRobotics / frc1388-2023

0 stars 0 forks source link

Add DataLogging #21

Open jtechau opened 1 year ago

jtechau commented 1 year ago

Add data logging via the DataLogManager in WPILib.

In the past, we've logged data to USB drives, using log4j or other logging libraries. WPILib now includes the DataLog and DataLogManager classes which provide similar functionality which is simpler to use, and utilities to download and interpret the data.

Logged data has proven to be valuable in past years. The ability to easily log various data and text, and download, visualize and process the data, will provide even more opportunity for optimizing data-driven implementations.

https://docs.wpilib.org/en/latest/docs/software/telemetry/datalog.html See also the utilities listed at the bottom of the referenced page.

Text messages should be logged using DataLogManager.log(), which logs to the messages log entry and also prints to the console.

Data values can be logged via the DoubleLogEntry class (see the link above). The log entry name should start with /robot/ and be of the form /robot/MyData.

See also Issue https://github.com/AGHSEagleRobotics/frc1388-2023/issues/31 (Data Visualization - AdvantageScope). This may replace or augment the use case for data logging during development and debug.

jtechau commented 1 year ago

I updated the build script to create a BuildInfo class. This can be used to log the version of software used on the robot, which helps with analyzing log files for the purpose of improving software.

See last year's code for an example.