-
Notifications
You must be signed in to change notification settings - Fork 2
Configuration
There are 2 configuration levels for Badgerlog: Global and instance specific.
Configured once on startup, cannot be changed after
Global configuration is done with DashboardConfig.
There are 3 options for configuring the global settings for Badgerlog.
Base table key
The table to use for NetworkTables. The table is placed at the highest level. (ie no other table contains it)
Struct options
The type of struct entries for NetworkTables. This setting can be overridden by instances of @Entry
Base packages
The base package to scan for annotations. Badgerlog scans the classpath for annotations, so it needs the package to scan.
It provides 2 baseline configurations
- Default (recommended)
- Base table key: "Badgerlog"
- Struct options: SUB_TABLE
- Base packages: "frc.robot"
- SmartDashboard
- Base table key: "SmartDashboard"
- Struct options: STRUCT
- Base packages: "frc.robot"
Badgerlog provides configuration using the chaining of multiple different annotations.
These annotations include
- Key
- Struct Type
- Unit Conversion
Annotating a field with any of these annotations overrides the default for the specific configuration.
Key: The @Key annotation changes the key used for NetworkTables entries.
Uses a string for the key
Struct Type: The @StructType annotation changes how entries of fields with a type extending from StructSerializable are created.
Uses the StructTypes enum
Current limitations:
StructTypes.STRUCT cannot have a subscriber attached (limitation with NetworkTables). Elastic also doesn't display Structs correctly.
Unit Conversion: The @UnitConversion annotation changes how entries with fields that have a convertible type are created.
Uses a string as a required type to convert to.
This string must be the name specified by the unit's field. It can be either the singular or plural form of it. Capitalization does not matter. (Ex: "Inch" or "Inches" works, but "In" does not)
Has an optional string that specifies the id of the converter.
This string is used only for mappings that have multiple units inside of them. (See TransformMappings for examples)
For most use cases, the defaults ids are "rotation" for angle types and "translation" for distance types
Javadoc can be found on Jitpack