Package xbot.common.properties


package xbot.common.properties
The property system. This allows sending values to Smart Dashboard and configuring software at runtime or reporting values back to the drivers' station.

In general, any property on the robot is for one specific purpose: Configuration. These values are written infrequently, but often read constantly. Typical use cases would be for PID constants, subsystem limits, thresholds, durations, and similar scenarios.

Properties load their values from a file on the robot (managed by WPI's Preferences system), and simultaneously publish those values to the SmartDashboard in the "Preferences" table. Here, they can be modified by drivers/programmers at runtime, and changes are immediately reflected in the robot's behavior.

The value of the properties in every robot "tick" is also persisted to AdvantageKit. Mostly this is just duplication, however, this automatic logging also lets the robot perform an accurate "replay mode" if any configuration values were changed at runtime.

Properties can be created with Important or Debug levels. Important properties are persisted to robot storage; Debug properties are kept entirely in memory, meaning they effectively "load from default" every time the robot boots.

This package used to have a separate Ephemeral property; that's been deprecated. If you want to publish an interesting value to the human operators (as well as log it to disc), use AdvantageKit's logger, as in the following example:

org.littletonrobotics.junction.Logger.recordOutput("DriveSubsystem/MaximumForwardSpeed", maxForwardSpeed);
or, for most commands/subsystems,
org.littletonrobotics.junction.Logger.recordOutput(this.getPrefix() + "/MaximumForwardSpeed", maxForwardSpeed);