java.lang.Object
io.github.tigerbotics7125.tigerlib.input.joystick.JoystickAxis
All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable

public class JoystickAxis extends Object implements edu.wpi.first.util.sendable.Sendable
  • Constructor Details

    • JoystickAxis

      public JoystickAxis(edu.wpi.first.wpilibj.GenericHID joystick, int axis, boolean inverted)
      Create a new JoystickAxis Object.
      Parameters:
      joystick - The HID controller to read the axis from.
      axis - The axis index.
      inverted - Whether to invert the axis from its raw reading.
  • Method Details

    • get

      public double get()
      Returns:
      Cleaning function applied to getRaw().
    • getRaw

      public double getRaw()
      Returns:
      Raw axis input, iverted if set.
    • setCleaner

      public void setCleaner(Function<Double,Double> inputCleanerFunction)
      Parameters:
      inputCleanerFunction - Function to clean the raw input.
    • invert

      public void invert()
      Invert the input from the current state.
    • initSendable

      public void initSendable(edu.wpi.first.util.sendable.SendableBuilder builder)
      Specified by:
      initSendable in interface edu.wpi.first.util.sendable.Sendable