1111namespace tkit {
1212
1313/* *
14- * Units.h - WPILib units library integration for TelemetryKit
14+ * Units.h
1515 *
16- * Provides automatic unit metadata extraction when logging WPILib unit types.
17- *
18- * Usage:
19- * #include <telemetrykit/core/Units.h>
16+ * Integration helpers for logging WPILib units with TelemetryKit.
17+ * Extracts numeric values and unit abbreviations automatically.
2018 *
19+ * Example:
2120 * tkit::RecordOutput("/Distance", units::meter_t{3.5});
2221 * tkit::RecordOutput("/Angle", units::degree_t{45.0});
2322 * tkit::RecordOutput("/Speed", units::meters_per_second_t{2.5});
2423 */
2524
2625namespace detail {
2726
28- // Type trait to detect if T is a units::unit_t type
27+ // Detects whether a type is a WPILib units::unit_t
2928template <typename T, typename = void >
3029struct is_unit_type : std::false_type {};
3130
@@ -38,7 +37,7 @@ struct is_unit_type<T, std::void_t<
3837template <typename T>
3938inline constexpr bool is_unit_type_v = is_unit_type<T>::value;
4039
41- // Get the unit abbreviation string for a units::unit_t type
40+ // Returns the abbreviation string for a unit type
4241template <typename UnitType>
4342std::string GetUnitAbbreviation () {
4443 return std::string (units::abbreviation (UnitType{}));
@@ -47,19 +46,13 @@ std::string GetUnitAbbreviation() {
4746} // namespace detail
4847
4948/* *
50- * Record an output value from a WPILib unit type.
51- *
52- * Automatically extracts the numeric value and unit abbreviation.
53- *
54- * Examples:
55- * tkit::RecordOutput("/Distance", units::meter_t{3.5});
56- * // Logs 3.5 with unit "m"
49+ * Records a value from a WPILib unit type.
5750 *
58- * tkit::RecordOutput("/Angle", units::degree_t{90.0});
59- * // Logs 90.0 with unit "deg"
51+ * The numeric value and unit abbreviation are logged automatically.
6052 *
61- * tkit::RecordOutput("/Speed", units::feet_per_second_t{10.0});
62- * // Logs 10.0 with unit "ft/s"
53+ * Example:
54+ * tkit::RecordOutput("/Distance", units::meter_t{3.5}); // 3.5, "m"
55+ * tkit::RecordOutput("/Angle", units::degree_t{90.0}); // 90.0, "deg"
6356 */
6457template <typename T>
6558inline auto RecordOutput (std::string_view key, const T& value)
0 commit comments