Class TuneValue

java.lang.Object
frc.spectrumLib.telemetry.TuneValue

public class TuneValue extends Object
A number that can be changed from a dashboard at runtime without redeploying, for tuning gains, speeds and other constants. Only in TuningMode; otherwise it is its default and nothing is published. For a value that should survive a deploy, use a frc.spectrumLib.params param instead.

Backed by AdvantageKit's LoggedNetworkNumber (in 2026 it read SmartDashboard directly), so the value is a logged input: a replayed match sees exactly the values the robot was tuned to at every moment. Published under /Tuning/<name>.

  • Constructor Details

    • TuneValue

      public TuneValue(String name, double defaultValue)
      Creates a TuneValue, publishing defaultValue if tuning mode is on.
      Parameters:
      name - dashboard key
      defaultValue - initial value
  • Method Details

    • update

      public Double update()
      Reads the current value and caches it locally.
      Returns:
      the latest value
    • getSupplier

      public DoubleSupplier getSupplier()
      Returns a DoubleSupplier that calls update() each time it is queried.
      Returns:
      a supplier backed by this TuneValue
    • getValue

      public double getValue()
      Current value, refreshed on each call to update().
    • getName

      public String getName()
      Dashboard key under which this value is published and read.