java.lang.Object
org.firstinspires.ftc.teamcode.fy23.gamepad2.primitives.axes.ExponentialAxis
All Implemented Interfaces:
Axis

public class ExponentialAxis extends Object implements 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

    Constructors
    Constructor
    Description
    ExponentialAxis(Axis.DoubleLambda axis, boolean invert, double power)
    Same as the other constructor, but allows for inverting the reported value
    ExponentialAxis(Axis.DoubleLambda axis, double power)
    Pass in a lambda expression that returns the value of a Gamepad 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 Type
    Method
    Description
    double
    The value of an axis depends on the implementation and its parameters.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ExponentialAxis

      public ExponentialAxis(Axis.DoubleLambda axis, double power)
      Pass in a lambda expression that returns the value of a Gamepad axis field: new ExponentialAxis( () -> gamepad.left_stick_x ); and this.value() will report the value of that axis taken to the specified power.
    • ExponentialAxis

      public ExponentialAxis(Axis.DoubleLambda axis, boolean invert, double power)
      Same as the other constructor, but allows for inverting the reported value
  • Method Details

    • value

      public double value()
      Description copied from interface: Axis
      The value of an axis depends on the implementation and its parameters.
      Specified by:
      value in interface Axis