Class JoystickAxis
java.lang.Object
io.github.tigerbotics7125.tigerlib.input.joystick.JoystickAxis
- All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable
-
Constructor Summary
ConstructorDescriptionJoystickAxis
(edu.wpi.first.wpilibj.GenericHID joystick, int axis, boolean inverted) Create a newJoystickAxis
Object. -
Method Summary
Modifier and TypeMethodDescriptiondouble
get()
double
getRaw()
void
initSendable
(edu.wpi.first.util.sendable.SendableBuilder builder) void
invert()
Invert the input from the current state.void
setCleaner
(Function<Double, Double> inputCleanerFunction)
-
Constructor Details
-
JoystickAxis
public JoystickAxis(edu.wpi.first.wpilibj.GenericHID joystick, int axis, boolean inverted) Create a newJoystickAxis
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
- 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 interfaceedu.wpi.first.util.sendable.Sendable
-