-
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
This type of entry will update the corresponding **NetworkTables **entry from the value on the field. (It publishes the field to NetworkTables)
Subscribers
This type of entry will set the field value to the corresponding NetworkTables entry. (It gets the value from NetworkTables)
Sendables
This type of entry must be on a field with the type of Sendable and will call Sendable.initSendable continuously
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