Package frc.spectrumLib.util
Class ExpCurve
java.lang.Object
frc.spectrumLib.util.Curve
frc.spectrumLib.util.ExpCurve
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
calculate
(double input) Calculates and returns a mapped value based on the curve.double
Returns the value ofexpVal
, the base of the exponent used to map the input.void
setExpVal
(double expVal) Sets the value ofexpVal
, the base of the exponent used to map the input.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()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 curveoffset
- value used to offset the final curvescalar
- value used to scale the value before offsetdeadzone
- value for the width of the deadband in the center of the curve
-
-
Method Details
-
calculate
public double calculate(double input) Description copied from class:Curve
Calculates and returns a mapped value based on the curve. -
setExpVal
public void setExpVal(double expVal) Sets the value ofexpVal
, the base of the exponent used to map the input.- Parameters:
expVal
- the new value ofexpVal
-
getExpVal
public double getExpVal()Returns the value ofexpVal
, the base of the exponent used to map the input.- Returns:
- the current value of
expVal
-