Class VisionTelemetryConfig
java.lang.Object
yall.telemetry.VisionTelemetryConfig
What a camera publishes to NetworkTables and logs to a WPILib DataLog, and where.
new VisionCameraConfig()
.withTelemetry(new VisionTelemetryConfig()
.withVerbosity(TelemetryVerbosity.LOW)
.withField(VisionTelemetryField.FILTER_STATS, true)
.withDataLog());
By default a camera publishes every TelemetryVerbosity.MID field to NetworkTables
under YALL/<camera name>, and logs nothing to a DataLog. withDataLog() logs the
same fields to DataLogManager's log, and withNetworkTables(boolean) turns NetworkTables off, such as at competition.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetDataLogPath(String cameraName) The path to log under, if logging to a DataLog.getTablePath(String cameraName) The table to publish under.How much to publish.booleanisEnabled(VisionTelemetryField field) Whether a field is published.booleanWhether to publish to NetworkTables.Logs the enabled fields toDataLogManager's log, under the same path as NetworkTables (YALL/<camera name>unlesswithTablePath(String)changes it).withDataLog(String path) Logs the enabled fields toDataLogManager's log under a path of its own, such as"Vision/front".withField(VisionTelemetryField field, boolean enabled) Turns one field on or off, whatever the verbosity.withNetworkTables(boolean enabled) Sets whether to publish to NetworkTables.withTablePath(String path) Sets the NetworkTables table to publish under, such as"Vision/front".withVerbosity(TelemetryVerbosity verbosity) Sets how much to publish.
-
Constructor Details
-
VisionTelemetryConfig
public VisionTelemetryConfig()Creates a config that publishes everyTelemetryVerbosity.MIDfield.
-
-
Method Details
-
withVerbosity
Sets how much to publish. Fields turned on or off withwithField(VisionTelemetryField, boolean)keep their setting.- Parameters:
verbosity- The verbosity.- Returns:
- This config, for chaining.
-
withField
Turns one field on or off, whatever the verbosity.- Parameters:
field- The field.enabled- true to publish it.- Returns:
- This config, for chaining.
-
withTablePath
Sets the NetworkTables table to publish under, such as"Vision/front". Defaults toYALL/<camera name>.- Parameters:
path- Table path, with/between tables.- Returns:
- This config, for chaining.
-
withNetworkTables
Sets whether to publish to NetworkTables. Defaults to true. With it off, a camera's fields only go to the DataLog, ifwithDataLog()is on, andstats/resetisn't available.- Parameters:
enabled- true to publish to NetworkTables.- Returns:
- This config, for chaining.
-
withDataLog
Logs the enabled fields toDataLogManager's log, under the same path as NetworkTables (YALL/<camera name>unlesswithTablePath(String)changes it). Each value is logged when it changes.DataLogManageralso logs NetworkTables by default, underNT:/. To log each value once, turn one of them off:withNetworkTables(boolean)here, orDataLogManager.logNetworkTables(false).- Returns:
- This config, for chaining.
-
withDataLog
Logs the enabled fields toDataLogManager's log under a path of its own, such as"Vision/front". SeewithDataLog().- Parameters:
path- Log entry path, with/between names.- Returns:
- This config, for chaining.
-
isNetworkTablesEnabled
public boolean isNetworkTablesEnabled()Whether to publish to NetworkTables.- Returns:
- true to publish to NetworkTables.
-
getDataLogPath
-
getVerbosity
-
isEnabled
Whether a field is published.- Parameters:
field- The field.- Returns:
- true if it is turned on, or is at or below the verbosity and not turned off.
-
getTablePath
-