TelemetryTable
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.
A table caches the tables and handles it hands out by name, but each lookup still splits the name and hits a map, so hold on to a table or a topic in a field rather than looking it up every loop. The fastest way to log is a typed handle:
private val table = Telemetry.table("Shooter")
private val velocity = table.doubleTopic("wheelVelocity")
private val ready = table.booleanTopic("ready")
fun periodic() {
velocity.set(encoder.velocity)
ready.set(atSpeed())
}log is the shorter way, which looks the handle up each time: table.log("wheelVelocity", encoder.velocity).
Names
A name with slashes, like a/b, is the same as asking for the table a and then the name b. Leading and doubled slashes are ignored, and so are all the slashes of a table name. A topic name that ends in a slash has no name, so it warns and drops the value.
Types
A path holds one type for as long as a backend is registered. Logging a different type to a path that a backend already has warns, and the value doesn't reach that backend. Telemetry never throws into the code that calls it. It reports what it can't log through the registry's warning handler.
Because the rule belongs to the backend, not the program, each OpMode starts clean: its backends are new, so it can give a path a type that an earlier OpMode gave it a different one for.
Struct values
Any other object is logged as a struct, with its schema reflected from its class by the registry's TelemetryRegistry.structs. See dev.nextftc.util.struct.StructSchemaRegistry for what is supported, and use topic with a hand-written StructSchema for a class that can't be reflected or to log faster.
A list can't be logged with log, because its element type is erased. Use arrayTopic, or the logArray extension.
A table may be used from any thread.
Properties
Functions
Returns the handle for the topic name that holds arrays of booleans.
Returns the handle for the boolean topic name.
Returns the handle for the topic name that holds arrays of doubles.
Returns the handle for the double topic name.
Returns the handle for the topic name that holds arrays of floats.
Returns the handle for the float topic name.
Returns the handle for the topic name that holds arrays of integers.
Returns the handle for the topic name that holds arrays of integers.
Returns the handle for the string topic name.
Returns the child table name, creating it if needed.