Package frc.spectrumLib.telemetry
Class TuneValue
java.lang.Object
frc.spectrumLib.telemetry.TuneValue
A numeric value that is published to SmartDashboard and can be modified at runtime without
redeploying code. Useful for tuning PID gains, speeds, and other constants during development.
Place a call to
update() or pass getSupplier() inside a command to read the
latest value each loop.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetName()SmartDashboard key under which this value is published and read.Returns aDoubleSupplierthat callsupdate()each time it is queried, suitable for passing to command factories that accept live-updating suppliers.doublegetValue()Current value, refreshed on each call toupdate().update()Reads the current value from SmartDashboard and caches it locally.
-
Constructor Details
-
TuneValue
Creates a TuneValue, publishingdefaultValueto SmartDashboard undername.- Parameters:
name- SmartDashboard keydefaultValue- Initial value written to SmartDashboard
-
-
Method Details
-
update
Reads the current value from SmartDashboard and caches it locally.- Returns:
- the latest value from SmartDashboard
-
getSupplier
Returns aDoubleSupplierthat callsupdate()each time it is queried, suitable for passing to command factories that accept live-updating suppliers.- Returns:
- a supplier backed by this TuneValue
-
getValue
public double getValue()Current value, refreshed on each call toupdate(). -
getName
SmartDashboard key under which this value is published and read.
-