REBUILT 2026 providesDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/robototes/REBUILT2026/llms.txt
Use this file to discover all available pages before exploring further.
NtTunableDouble, NtTunableBoolean, and NtTunableInteger — lightweight wrappers that publish a default value to NetworkTables on startup and read back live overrides from any connected dashboard. This makes it possible to adjust vision weights, feature flags, and other parameters mid-session without redeploying robot code.
How they work
Each wrapper follows the same pattern:Construct with a path and default
Pass the full NT4 key path and a default value. The constructor creates both a publisher (so the topic is immediately visible in the dashboard) and a subscriber with the default as the fallback.
Read the current value with .get()
Each call to
.get() returns the live value from the subscriber — either the dashboard override or the default if no override has been sent yet.Optionally push updates from robot code
Call
.set(value) to update the published value from the robot side (for example, to reflect a new computed default). Dashboard overrides will continue to take precedence once set.Tunable types
| Class | NT4 Type | .get() return | Typical use |
|---|---|---|---|
NtTunableDouble | double | double | Continuous coefficients, thresholds |
NtTunableBoolean | boolean | boolean | Feature enable/disable flags |
NtTunableInteger | integer | int | Iteration counts, discrete setpoints |
All tunables defined in the codebase
| NT Key | Type | Default | Purpose |
|---|---|---|---|
/vision/A_XY_MT2 | Double | 0.07 | Amplitude coefficient for MegaTag2 XY standard deviation |
/vision/A_XY_MT1 | Double | 0.09 | Amplitude coefficient for MegaTag1 XY standard deviation |
/vision/P_XY | Double | 1.4 | Distance exponent in the std-dev formula (dist^P_XY) |
/vision/defenseStdDevScale | Double | 0.5 | Multiplier applied to std devs when defense contact is detected (< 1.0 = trust vision more) |
/vision/disablevision | Boolean | false | Set to true to disable all vision pose fusion |
/vision/disablevision is subscribed as a raw BooleanSubscriber in VisionSubsystem rather than through an NtTunableBoolean wrapper, but it is functionally identical — the default is false and any dashboard write is picked up on the next update() call.Using tunables from a dashboard
Any NT4-compatible dashboard (SmartDashboard, Shuffleboard, Elastic) can read and write tunable values without any additional configuration.Open a dashboard and connect to the robot
Launch Elastic (or Shuffleboard) and ensure it is connected to the robot’s NetworkTables server.
Locate the NT key in the source tree
Navigate to the key path (e.g.,
/vision/A_XY_MT2) in the NT browser. The value will already be visible because the robot published the default at startup.HubShiftUtil: alliance color override via driver controller
HubShiftUtil manages game-piece shift scheduling and hub targeting. It exposes an alliance color override that is normally driven by the FMS game-specific message, but can be forced from the driver controller for off-alliance testing:
AllianceUtils.getHubTranslation2d() returns the hub coordinates for the overridden alliance, allowing the robot to target the opponent’s hub during testing without an FMS connection.
GCMonitor
GCMonitor registers JMX listeners on the JVM’s garbage collectors and increments an internal counter each time a GC event fires. Each event is logged as a text message via DataLogManager with the GC action, collector name, and duration. Robot.java separately publishes the running count to SmartDashboard (and thus to the NT4-mirrored DataLog) under the key GCCount:
GCCount SmartDashboard entry (visible in the DataLog via NT4 mirroring) post-match to identify periods of elevated GC pressure, which can cause loop overruns. If GC frequency increases noticeably, look for hotspots allocating objects in periodic methods.
All NT tunable writes are captured in the WPILib DataLog automatically (because the NT4 server mirrors subscribed topics to the log). After a practice match you can replay the
.wpilog file and see exactly which values were changed and when — useful for correlating a tuning change with observed robot behavior.