-
Notifications
You must be signed in to change notification settings - Fork 2
Home
Badgerlog is a modern, annotation-based NetworkTables utility.
There are multiple steps in installation.
- Add a new vendor dependency to a robot project.
https://raw.githubusercontent.com/team1306/badger-log/master/vendordep.json - To enable annotation processing add
annotationProcessor 'com.github.team1306:badger-log:2025.2.2'todependenciesinbuild.gradle
Annotation processing will ensure fields annotated with @Entry, any Configurable annotation or @MappingType match the requirements specified in Annotation Requirements
Badgerlog has many capabilities as a NetworkTables utility.
There are 2 methods that need to be called at different points.
Dashboard.initialize must be called on robot startup (Usually Robot.robotInit)
Failure to configure the Dashboard will result in no entries being created, as well as no methods in Dashboard working.
Dashboard.update must be called periodically (Usually Robot.robotPeriodic)
Failure to run update periodically will result in NetworkTables entries not updating
Badgerlog operates mainly with the @Entry annotation combined with config annotations. See Instance Configuration for more.
To create a publisher, subscriber, or sendable, annotate a field with @Entry. The classpath scanning set up in Dashboard.initialize will scan for instances of this annotation and create an associated NetworkTables entry.
By default, Badgerlog uses a NetworkTables key of the field name, underneath a table with the class name. String equivalent to [Class Name]/[Field Name]
Publishers
When a publisher is created then the associated NetworkTables entry will be automatically updated from the field value. Any field changes will reflect in NetworkTables immediately.
Subscribers
When a subscriber is created then the field will set its value from the associated NetworkTables entry. Any changes in NetworkTables updates the field with the new value.
Sendables
When a sendable is created then the Sendable is registered with the SendableRegistry and updated from the definition.
All fields annotated with @Entry or @MappingType must follow the following rules.
- Must be non final
- Must be static
$$^1$$ - Must have been statically initialized and non null
$$^2$$
See Configuration
The Javadoc can be found on Jitpack
Javadoc can be found on Jitpack