Class ExponentialAxis
java.lang.Object
org.firstinspires.ftc.teamcode.fy23.gamepad2.primitives.axes.ExponentialAxis
- All Implemented Interfaces:
Axis
Represents an axis on a
Gamepad
, including sticks and
triggers, and reports the value taken to the power specified in the constructor (this creates a
simple response curve - find out what it is by graphing y=x^[power] - y=x^2, for example)-
Nested Class Summary
Nested classes/interfaces inherited from interface org.firstinspires.ftc.teamcode.fy23.gamepad2.primitives.Axis
Axis.DoubleLambda
-
Constructor Summary
ConstructorDescriptionExponentialAxis
(Axis.DoubleLambda axis, boolean invert, double power) Same as the other constructor, but allows for inverting the reported valueExponentialAxis
(Axis.DoubleLambda axis, double power) Pass in a lambda expression that returns the value of aGamepad
axis field: new ExponentialAxis( () -> gamepad.left_stick_x ); and this.value() will report the value of that axis taken to the specified power. -
Method Summary
Modifier and TypeMethodDescriptiondouble
value()
The value of an axis depends on the implementation and its parameters.
-
Constructor Details
-
ExponentialAxis
Pass in a lambda expression that returns the value of aGamepad
axis field: new ExponentialAxis( () -> gamepad.left_stick_x ); and this.value() will report the value of that axis taken to the specified power. -
ExponentialAxis
Same as the other constructor, but allows for inverting the reported value
-
-
Method Details