Telemetry

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

Telemetry.log("Battery/Voltage", voltageSensor.voltage)

val drive = Telemetry.table("Drive")
val velocity = drive.doubleTopic("leftVelocity")
velocity.set(left.velocity)
drive.log("pose", follower.pose)

Values go to the backends registered on registry. On a robot, NextFTC registers them for each OpMode. In a unit test, register a dev.nextftc.telemetry.backend.MockTelemetryBackend and read back what was logged, or build a TelemetryRegistry of your own.

Everything here forwards to the root table. See TelemetryTable for how values are typed, what a name holds, and what thread safety to expect.

Properties

Link copied to clipboard

The registry this facade logs through.

Link copied to clipboard

The root table, which every other table is under.

Functions

Link copied to clipboard
fun <T : Any> arrayTopic(name: String, schema: StructSchema<T>): Topic<List<T>>

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

fun <T : Any> arrayTopic(name: String, type: Class<T>): Topic<List<T>>
fun <T : Any> arrayTopic(name: String, type: KClass<T>): Topic<List<T>>

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

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.

Link copied to clipboard

Returns the handle for the topic name that holds arrays of booleans.

Link copied to clipboard

Returns the handle for the boolean topic name.

Link copied to clipboard

Returns the handle for the topic name that holds arrays of doubles.

Link copied to clipboard

Returns the handle for the double topic name.

Link copied to clipboard

Returns the handle for the topic name that holds arrays of floats.

Link copied to clipboard

Returns the handle for the float topic name.

Link copied to clipboard

Returns the handle for the topic name that holds arrays of integers.

Link copied to clipboard

Returns the handle for the integer topic name, for values that fit in an Int.

Link copied to clipboard
fun log(name: String, value: Any)

Logs value at name, choosing how from what it is.

fun log(name: String, value: Boolean)

Logs value to the boolean topic name.

fun log(name: String, value: BooleanArray)

Logs value to the topic name that holds arrays of booleans.

fun log(name: String, value: Double)

Logs value to the double topic name.

fun log(name: String, value: DoubleArray)

Logs value to the topic name that holds arrays of doubles.

fun log(name: String, value: Float)

Logs value to the float topic name.

fun log(name: String, value: FloatArray)

Logs value to the topic name that holds arrays of floats.

fun log(name: String, value: Int)
fun log(name: String, value: Long)

Logs value to the integer topic name.

fun log(name: String, value: IntArray)
fun log(name: String, value: LongArray)

Logs value to the topic name that holds arrays of integers.

fun log(name: String, value: String)

Logs value to the string topic name.

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.

Link copied to clipboard

Returns the handle for the topic name that holds arrays of integers.

Link copied to clipboard

Returns the handle for the integer topic name.

Link copied to clipboard

Returns the handle for the topic name that holds arrays of strings.

Link copied to clipboard

Returns the handle for the string topic name.

Link copied to clipboard

Returns the table name, creating it if needed. Hold on to it instead of looking it up every loop.

Link copied to clipboard
fun <T : Any> topic(name: String, schema: StructSchema<T>): Topic<T>

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

fun <T : Any> topic(name: String, type: Class<T>): Topic<T>
fun <T : Any> topic(name: String, type: KClass<T>): Topic<T>

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

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.