Skip to content
Bradley Chumanov edited this page Aug 12, 2025 · 29 revisions
drawing
Badgerlog is a modern, annotation-based NetworkTables utility.

Getting Started

Installation

There are multiple steps in installation.

  1. Add a new vendor dependency to a robot project. https://raw.githubusercontent.com/team1306/badger-log/master/vendordep.json
  2. To enable annotation processing add annotationProcessor 'com.github.team1306:badger-log:2025.2.2' to dependencies in build.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.

Initial Setup

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

Basic Usage

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

Annotation Requirements

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$$

$$^1$$ Fields must be static because they are effectively static regardless. If a field is "bound" to a NetworkTable entry, then all instances would be updated, whether it was static or not. Static fields explicitly state that they are not bound to a specific instance, which is why it is a requirement.

$$^2$$ Fields must be initialized and non-null because Badgerlog needs the specific value on the field to be published to NetworkTables on startup. Null results in missing values and undefined behavior, which is why initialization is a requirement.

Configuration Options

See Configuration

Documentation

The Javadoc can be found on Jitpack

Clone this wiki locally