Class JoystickAxis
java.lang.Object
io.github.tigerbotics7125.tigerlib.input.joystick.JoystickAxis
- All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable
-
Constructor Summary
ConstructorsConstructorDescriptionJoystickAxis(edu.wpi.first.wpilibj.GenericHID joystick, int axis, boolean inverted) Create a newJoystickAxisObject. -
Method Summary
Modifier and TypeMethodDescriptiondoubleget()doublegetRaw()voidinitSendable(edu.wpi.first.util.sendable.SendableBuilder builder) voidinvert()Invert the input from the current state.voidsetCleaner(Function<Double, Double> inputCleanerFunction)
-
Constructor Details
-
JoystickAxis
public JoystickAxis(edu.wpi.first.wpilibj.GenericHID joystick, int axis, boolean inverted) Create a newJoystickAxisObject.- 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
- 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:
initSendablein interfaceedu.wpi.first.util.sendable.Sendable
-