Class ExpCurve

java.lang.Object
frc.spectrumLib.util.Curve
frc.spectrumLib.util.ExpCurve

public class ExpCurve extends Curve
This class maps the value of a input to an exponential curve. It is a subclass of Curve. Modified to allow outputs larger than 1.0
  • Constructor Details

    • ExpCurve

      public ExpCurve()
      Constructs an Exponential Curve object which can be used to map a stick input exponentially. Initialized with default values: expVal = 1.0; offset = 0.0; scalar = 1.0; deadzone = 0.0;
    • ExpCurve

      public ExpCurve(double expVal, double offset, double scalar, double deadzone)
      Constructs an Exponential Curve object which can be used to map a stick input exponentially. Initialized with values provided.
      Parameters:
      expVal - value of the base of the exponent used in the curve
      offset - value used to offset the final curve
      scalar - value used to scale the value before offset
      deadzone - value for the width of the deadband in the center of the curve
  • Method Details

    • calculate

      public double calculate(double input)
      Applies the full exponential curve pipeline: deadzone, exponent, scalar, then offset.
      Specified by:
      calculate in class Curve
      Parameters:
      input - the raw input value to be mapped (typically in [-1, 1])
      Returns:
      the mapped output value
    • setExpVal

      public void setExpVal(double expVal)
      Sets the value of expVal, the base of the exponent used to map the input.
      Parameters:
      expVal - the new value of expVal
    • getExpVal

      public double getExpVal()
      Returns the value of expVal, the base of the exponent used to map the input.
      Returns:
      the current value of expVal