Package-level declarations

Telemetry, the entry point, which wraps a shared TelemetryRegistry. Log by name with Telemetry.log("Drive/Pose", pose), or hold a typed handle for the fast path: DoubleTopic, IntTopic, LongTopic, FloatTopic and BooleanTopic for numbers and booleans, and Topic<T> for strings, arrays, structs, and lists of structs. TelemetryTable groups related topics under a path, and TelemetryLoggable lets an object publish its own fields. For a type you don't own, register a TelemetryTypeHandler in TelemetryRegistry.handlers; Measure has one by default, which logs the base-unit value with its unit.

The registry stamps each value, sends it to every registered backend (or only those registered for a path prefix), and reports problems through a warning handler instead of throwing. A path keeps one type while a backend is registered, repeated numbers and strings are skipped unless a handle's keepDuplicates is set, and a handle made before any backend exists starts working when one is registered.

A handle can carry properties, the first being a unit that dashboards such as AdvantageScope show and convert: table.doubleTopic("wheelVelocity").withUnit("m/s"). They go out when the path is first published, as the properties of the NetworkTables announcement and as the metadata of the log entry, laid out the way WPILib logs NetworkTables topics. Values are strings, booleans, or finite numbers.

TelemetryBackend and TelemetryEntry are what a destination implements.

Types

Link copied to clipboard

A handle on a boolean topic.

Link copied to clipboard

A handle on a double topic.

Link copied to clipboard

A handle on a float topic.

Link copied to clipboard

A handle on an integer topic, for values that fit in an Int. For larger ones use LongTopic.

Link copied to clipboard

A handle on an integer topic.

Link copied to clipboard
class StructType(val schema: StructSchema<*>, val isArray: Boolean = false) : TelemetryType

A struct, or an array of them, described by schema.

Link copied to clipboard
object Telemetry

The entry point for telemetry: a shared TelemetryRegistry and its root table.

Link copied to clipboard

A destination for logged values: a log file, a live server, a test double.

Link copied to clipboard
interface TelemetryEntry

Where the values of one path end up.

Link copied to clipboard
fun interface TelemetryLoggable

An object that knows how to publish itself into a TelemetryTable.

Link copied to clipboard

The names of topic properties that dashboards understand.

Link copied to clipboard
class TelemetryRegistry @JvmOverloads constructor(val timeSource: TimeSource.WithComparableMarks = TimeSource.Monotonic, val origin: ComparableTimeMark = timeSource.markNow())

The set of TelemetryBackends that logged values are routed to, plus the clock that stamps them.

Link copied to clipboard

A namespace of logged values: a path like /Drive, whose topics are /Drive/leftVelocity and so on, and whose children are tables like /Drive/Odometry.

Link copied to clipboard
abstract class TelemetryTopic

A handle on one telemetry path, which values are set on.

Link copied to clipboard
sealed interface TelemetryType

What a telemetry path holds: one of the ValueTypes, or a StructType.

Link copied to clipboard
fun interface TelemetryTypeHandler<T : Any>

Knows how to publish values of a type that can't publish themselves, such as one from a library.

Link copied to clipboard

The TelemetryTypeHandlers of a TelemetryRegistry, by the type they handle.

Link copied to clipboard

Receives the warnings telemetry reports instead of throwing.

Link copied to clipboard

A handle on a topic of reference values: strings, arrays, structs, and lists of structs.

Link copied to clipboard

The types that aren't structs. Integers of every width are INTEGER.

Functions

Link copied to clipboard
inline fun <T : Any> Telemetry.arrayTopic(name: String): Topic<List<T>>

Returns the handle for the topic name under the root that holds arrays of structs of T.

inline fun <T : Any> TelemetryTable.arrayTopic(name: String): Topic<List<T>>

Returns the handle for the topic name that holds arrays of structs of T.

Link copied to clipboard
inline fun <T : Any> Telemetry.logArray(name: String, values: List<T>)

Logs values, a list of structs of T, to the topic name under the root.

inline fun <T : Any> TelemetryTable.logArray(name: String, values: List<T>)

Logs values, a list of structs of T, to the topic name.

Link copied to clipboard
inline fun <T : Any> Telemetry.topic(name: String): Topic<T>

Returns the handle for the struct topic name under the root, which holds values of T.

inline fun <T : Any> TelemetryTable.topic(name: String): Topic<T>

Returns the handle for the struct topic name, which holds values of T.

Link copied to clipboard
fun <T : TelemetryTopic> T.withProperties(vararg properties: Pair<String, Any>): T

Sets properties on this topic, in addition to the ones it has, and returns the handle.

Link copied to clipboard
fun <T : TelemetryTopic> T.withUnit(unit: String): T

Sets the unit of this topic's values, which dashboards show, and returns the handle.