Class Telemetry
For more advanced use cases, use the NetworkTables or DataLog APIs directly.
-
Method Summary
Modifier and TypeMethodDescriptionstatic TelemetryTablegetTable()Gets the root telemetry table.static TelemetryTableGets a child telemetry table.static voidkeepDuplicates(String name) Indicates duplicate values should be preserved.static voidLogs a boolean.static voidLogs a boolean array.static voidLogs a byte.static voidLogs a raw value (byte array).static voidLogs a raw value (byte array) with custom type string.static voidLogs a double.static voidLogs a double array.static voidLogs a float.static voidLogs a float array.static voidLogs an int.static voidLogs an int array.static voidLogs a long.static voidLogs a long array.static voidLogs a short.static voidLogs a short array.static voidLogs a generic object.static voidLogs a generic array.static voidLogs a String.static voidLogs a String array.static voidLogs a String with custom type string.static voidlog(String name, Collection<?> value) Rejects logging a collection without an explicit element type.static voidlog(String name, Collection<?> value, Class<?> elementType) Logs a collection with an explicit element type.static <T> voidlog(String name, Collection<T> value, Struct<? super T> struct) Logs a collection of objects with a Struct serializer.static <T> voidLogs an array of objects with a Struct serializer.static <T> voidLogs an object with a Protobuf serializer.static <T> voidLogs an object with a Struct serializer.static voidsetProperty(String name, String key, String value) Sets property for a value.
-
Method Details
-
getTable
-
getTable
Gets a child telemetry table.- Parameters:
name- table name- Returns:
- table
-
keepDuplicates
Indicates duplicate values should be preserved. Normally duplicate values are ignored.- Parameters:
name- the name
-
setProperty
-
log
Logs a generic object.For non-null values, the value is dispatched in this order:
TelemetryLoggable,StructSerializable,ProtobufSerializable, boxed primitive and string types, and finally handlers registered withTelemetryRegistry.registerTypeHandler(Class, TelemetryRegistry.TypeHandler).TelemetryLoggablevalues are logged to a child table namedname. Struct and protobuf serializable values are logged with their public staticstructorprotoserializers.Boolean,Float,Double,Byte,Short,Integer,Long, otherNumbervalues, andStringare logged as primitive or string entries. GenericNumbervalues other than boxed integral types are logged as double entries. If no registered handler matches, the value falls back to being logged as a string usingObject.toString(). Collection values must be logged with an explicit element type.- Parameters:
name- the namevalue- the value; must be non-null
-
log
-
log
-
log
-
log
-
log
public static void log(String name, Collection<?> value) throws CollectionElementTypeRequiredException Rejects logging a collection without an explicit element type.Use
log(String, Collection, Class)orlog(String, Collection, Struct)instead.- Parameters:
name- the namevalue- the value- Throws:
CollectionElementTypeRequiredException- always
-
log
Logs a collection of objects with a Struct serializer.- Type Parameters:
T- data type- Parameters:
name- the namevalue- the valuestruct- struct serializer for the value type or one of its supertypes
-
log
Logs a collection with an explicit element type.The element type selects the backend representation.
Byteelement types are logged as raw byte arrays.Boolean,Float,Double, andStringelement types are logged like arrays of the same element type.Numberand other non-integral number element types are logged as double arrays.Short,Integer, andLongelement types are logged as integer arrays. Struct-serializable element types are logged with their public staticstructserializer. Other element types fall back to string arrays usingObject.toString().- Parameters:
name- the namevalue- the valueelementType- the collection element type
-
log
Logs a boolean.- Parameters:
name- the namevalue- the value
-
log
Logs a byte.- Parameters:
name- the namevalue- the value
-
log
Logs a short.- Parameters:
name- the namevalue- the value
-
log
Logs an int.- Parameters:
name- the namevalue- the value
-
log
Logs a long.- Parameters:
name- the namevalue- the value
-
log
Logs a float.- Parameters:
name- the namevalue- the value
-
log
Logs a double.- Parameters:
name- the namevalue- the value
-
log
-
log
-
log
Logs a boolean array.- Parameters:
name- the namevalue- the value
-
log
Logs a short array.- Parameters:
name- the namevalue- the value
-
log
Logs an int array.- Parameters:
name- the namevalue- the value
-
log
Logs a long array.- Parameters:
name- the namevalue- the value
-
log
Logs a float array.- Parameters:
name- the namevalue- the value
-
log
Logs a double array.- Parameters:
name- the namevalue- the value
-
log
-
log
Logs a raw value (byte array).- Parameters:
name- the namevalue- the value
-
log
-