Package com.flarerobotics.lib
Class TunableNumber
java.lang.Object
com.flarerobotics.lib.TunableNumber
A number which can be tuned in SmartDashboard. For any numbers that need to be tuned during
runtime.
Can be used for: PID tuning, elevator height tuning, ...
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
get()
If tuning mode is enabled, returns the tuned number.double
Returns the default value.void
setDefault
(double defaultValue) Sets the default value of the number.
-
Field Details
-
doTuning
public static boolean doTuning
-
-
Constructor Details
-
TunableNumber
Constructs a new TunableNumber.- Parameters:
key
- The key on SmartDashboard.
-
-
Method Details
-
get
public double get()If tuning mode is enabled, returns the tuned number. Otherwise returns the default value.- Returns:
- The current value.
-
getDefault
public double getDefault()Returns the default value.- Returns:
- The default value.
-
setDefault
public void setDefault(double defaultValue) Sets the default value of the number.- Parameters:
defaultValue
- The default value.
-