Class TunableTable

java.lang.Object
org.wpilib.tunable.TunableTable

public final class TunableTable extends Object
Tunables are used to allow values in the robot program to be changed from dashboards or debug tools.

Getter/setter-backed publish methods take getters and setters that must not throw.

For more advanced use cases, use NetworkTables directly.

  • Method Details

    • getPath

      public String getPath()
      Gets the table path.
      Returns:
      path with trailing "/"
    • getTable

      public TunableTable getTable(String name)
      Gets a child tunable table.
      Parameters:
      name - table name
      Returns:
      table
    • publish

      public boolean publish(String name, TunableBase tunable)
      Publishes a tunable.
      Parameters:
      name - the name
      tunable - the tunable
      Returns:
      true if the backend accepted the tunable
    • publish

      public boolean publish(String name, ComplexTunable tunable)
      Publishes a complex tunable.
      Parameters:
      name - the name
      tunable - the tunable
      Returns:
      true if the backend accepted the tunable
    • publishValue

      public <T> Tunable<T> publishValue(String name, Supplier<T> getter, Consumer<T> setter, Class<T> cls)
      Publishes a tunable value using a getter and setter.
      Type Parameters:
      T - value type
      Parameters:
      name - the name
      getter - the getter
      setter - the setter
      cls - the class of the value
      Returns:
      the tunable
    • publishValue

      public <T> Tunable<T> publishValue(String name, Supplier<T> getter, Consumer<T> setter, Class<T> cls, TunableConfig config)
      Publishes a tunable value using a getter and setter.
      Type Parameters:
      T - value type
      Parameters:
      name - the name
      getter - the getter
      setter - the setter
      cls - the class of the value
      config - tunable config
      Returns:
      the tunable
    • publishBoolean

      public TunableBoolean publishBoolean(String name, BooleanSupplier getter, BooleanConsumer setter)
      Publishes a tunable boolean value using a getter and setter.
      Parameters:
      name - the name
      getter - the getter
      setter - the setter
      Returns:
      the tunable
    • publishBoolean

      public TunableBoolean publishBoolean(String name, BooleanSupplier getter, BooleanConsumer setter, TunableConfig config)
      Publishes a tunable boolean value using a getter and setter.
      Parameters:
      name - the name
      getter - the getter
      setter - the setter
      config - tunable config
      Returns:
      the tunable
    • publishInt

      public TunableInt publishInt(String name, IntSupplier getter, IntConsumer setter)
      Publishes a tunable integer value using a getter and setter.
      Parameters:
      name - the name
      getter - the getter
      setter - the setter
      Returns:
      the tunable
    • publishInt

      public TunableInt publishInt(String name, IntSupplier getter, IntConsumer setter, TunableConfig config)
      Publishes a tunable integer value using a getter and setter.
      Parameters:
      name - the name
      getter - the getter
      setter - the setter
      config - tunable config
      Returns:
      the tunable
    • publishLong

      public TunableLong publishLong(String name, LongSupplier getter, LongConsumer setter)
      Publishes a tunable long value using a getter and setter.
      Parameters:
      name - the name
      getter - the getter
      setter - the setter
      Returns:
      the tunable
    • publishLong

      public TunableLong publishLong(String name, LongSupplier getter, LongConsumer setter, TunableConfig config)
      Publishes a tunable long value using a getter and setter.
      Parameters:
      name - the name
      getter - the getter
      setter - the setter
      config - tunable config
      Returns:
      the tunable
    • publishFloat

      public TunableFloat publishFloat(String name, FloatSupplier getter, FloatConsumer setter)
      Publishes a tunable float value using a getter and setter.
      Parameters:
      name - the name
      getter - the getter
      setter - the setter
      Returns:
      the tunable
    • publishFloat

      public TunableFloat publishFloat(String name, FloatSupplier getter, FloatConsumer setter, TunableConfig config)
      Publishes a tunable float value using a getter and setter.
      Parameters:
      name - the name
      getter - the getter
      setter - the setter
      config - tunable config
      Returns:
      the tunable
    • publishDouble

      public TunableDouble publishDouble(String name, DoubleSupplier getter, DoubleConsumer setter)
      Publishes a tunable double value using a getter and setter.
      Parameters:
      name - the name
      getter - the getter
      setter - the setter
      Returns:
      the tunable
    • publishDouble

      public TunableDouble publishDouble(String name, DoubleSupplier getter, DoubleConsumer setter, TunableConfig config)
      Publishes a tunable double value using a getter and setter.
      Parameters:
      name - the name
      getter - the getter
      setter - the setter
      config - tunable config
      Returns:
      the tunable
    • remove

      public void remove(String name)
      Removes a tunable.
      Parameters:
      name - name