Class ConfigurableLinearInterpolation

java.lang.Object
me.nabdev.oxconfig.sampleClasses.ConfigurableLinearInterpolation
All Implemented Interfaces:
ConfigurableClass

public class ConfigurableLinearInterpolation extends Object implements ConfigurableClass
A configurable linear interpolation function. This class is an example of implementing ConfigurableClass, but is safe for competition use.
  • Constructor Details

    • ConfigurableLinearInterpolation

      public ConfigurableLinearInterpolation(String key)
      Allocates a ConfigurableLinearInterpolation and registers it to OxConfig
      Parameters:
      key - The json key for the controller to be stored in
  • Method Details

    • getParameters

      public List<ConfigurableClassParam<?>> getParameters()
      Description copied from interface: ConfigurableClass
      Gets the parameters of the configurable class
      Specified by:
      getParameters in interface ConfigurableClass
      Returns:
      The parameters of the configurable class
    • getKey

      public String getKey()
      Description copied from interface: ConfigurableClass
      Gets the key of the configurable class (e.g. "Arm"), must not include commas
      Specified by:
      getKey in interface ConfigurableClass
      Returns:
      The key of the configurable class
    • getPrettyName

      public String getPrettyName()
      Description copied from interface: ConfigurableClass
      Gets the pretty name of the configurable class (e.g. "Arm")
      Specified by:
      getPrettyName in interface ConfigurableClass
      Returns:
      The pretty name of the configurable class
    • calculate

      public double calculate(double x)
      Calculates the y value of the linear interpolation function at the given x
      Parameters:
      x - The x value to calculate
      Returns:
      The y value of the linear interpolation function at the given x
    • getY1

      public double getY1()
      Gets the y1 value
      Returns:
      The y1 value
    • getY2

      public double getY2()
      Gets the y2 value
      Returns:
      The y2 value
    • getX1

      public double getX1()
      Gets the x1 value
      Returns:
      The x1 value
    • getX2

      public double getX2()
      Gets the x2 value
      Returns:
      The x2 value