Package frc.spectrumLib.util
Class ExpCurve
java.lang.Object
frc.spectrumLib.util.Curve
frc.spectrumLib.util.ExpCurve
Maps a stick input in [-1, 1] through an exponential of base
expVal, keeping the result
in [-1, 1] and preserving sign. The scalar and offset applied after the exponent set the range of
the final value.-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class frc.spectrumLib.util.Curve
calculateDeadzone, calculateOffset, calculateScalar, getCurvePoints, getDeadzone, getOffset, getScalar, printPoints, printPoints, setDeadzone, setOffset, setScalar
-
Constructor Details
-
ExpCurve
public ExpCurve() -
ExpCurve
public ExpCurve(double expVal, double offset, double scalar, double deadzone)
-
-
Method Details
-
calculate
public double calculate(double input) Applies the deadzone, then the exponent, then the scalar, then the offset. The deadzone is the innermost call, so it runs first. -
setExpVal
public void setExpVal(double expVal) A base at or below zero falls back to 1.0, leaving the input uncurved. A negative base would raise a fractional power and produce imaginary results. -
getExpVal
public double getExpVal()
-