Interface JoystickMode

  • All Superinterfaces:
    java.util.function.Function<java.lang.Double,​java.lang.Double>
    All Known Implementing Classes:
    CubedJoystickMode, DeadbandJoystickMode, InvertedJoystickMode, LinearJoystickMode, ScaledJoystickMode, SquaredJoystickMode, SquareRootedJoystickMode
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface JoystickMode
    extends java.util.function.Function<java.lang.Double,​java.lang.Double>
    Interface for "Mode" objects which apply some function to a Joystick's input. Examples include squaring the raw input values from the Joystick so that, for example, a raw reading of 0.5 on the X axis will instead read out as 0.25. Implementing a JoystickMode is also how one might handle setting an input deadband on their Joysticks.
    • Method Detail

      • adjust

        double adjust​(double raw)
        Applies some transformation function to the input and returns a result.
        Parameters:
        raw - the value to adjust
        Returns:
        the adjusted value
      • apply

        default java.lang.Double apply​(java.lang.Double value)
        Specified by:
        apply in interface java.util.function.Function<java.lang.Double,​java.lang.Double>