Package org.parts3492.partslib.input
Class PARTsCommandController
java.lang.Object
org.parts3492.partslib.input.PARTsCommandController
-
Constructor Summary
ConstructorsConstructorDescriptionPARTsCommandController(int port, boolean disableAutomaticDetection) PARTsCommandController(int port, PARTsController.ControllerType controllerType) -
Method Summary
Modifier and TypeMethodDescriptionedu.wpi.first.wpilibj2.command.button.Triggera()Constructs a Trigger instance around the A button's digital signal.edu.wpi.first.wpilibj2.command.button.Triggera(edu.wpi.first.wpilibj.event.EventLoop loop) Constructs a Trigger instance around the A button's digital signal.edu.wpi.first.wpilibj2.command.button.TriggeraxisGreaterThan(int axis, double threshold) Constructs a Trigger instance that is true when the axis value is less thanthreshold, attached tothe default command scheduler button loop.edu.wpi.first.wpilibj2.command.button.TriggeraxisGreaterThan(int axis, double threshold, edu.wpi.first.wpilibj.event.EventLoop loop) Constructs a Trigger instance that is true when the axis value is greater thanthreshold, attached to the given loop.edu.wpi.first.wpilibj2.command.button.TriggeraxisLessThan(int axis, double threshold) Constructs a Trigger instance that is true when the axis value is less thanthreshold, attached tothe default command scheduler button loop.edu.wpi.first.wpilibj2.command.button.TriggeraxisLessThan(int axis, double threshold, edu.wpi.first.wpilibj.event.EventLoop loop) Constructs a Trigger instance that is true when the axis value is less thanthreshold, attached to the given loop.edu.wpi.first.wpilibj2.command.button.TriggeraxisMagnitudeGreaterThan(int axis, double threshold) Constructs a Trigger instance that is true when the axis magnitude value is greater thanthreshold, attached tothe default command scheduler button loop.edu.wpi.first.wpilibj2.command.button.TriggeraxisMagnitudeGreaterThan(int axis, double threshold, edu.wpi.first.wpilibj.event.EventLoop loop) Constructs a Trigger instance that is true when the axis magnitude value is greater thanthreshold, attached to the given loop.edu.wpi.first.wpilibj2.command.button.Triggerb()Constructs a Trigger instance around the B button's digital signal.edu.wpi.first.wpilibj2.command.button.Triggerb(edu.wpi.first.wpilibj.event.EventLoop loop) Constructs a Trigger instance around the B button's digital signal.edu.wpi.first.wpilibj2.command.button.Triggerback()Constructs a Trigger instance around the back button's digital signal.edu.wpi.first.wpilibj2.command.button.Triggerback(edu.wpi.first.wpilibj.event.EventLoop loop) Constructs a Trigger instance around the back button's digital signal.doubleGet the left trigger axis value of the controller.doublegetLeftX()Get the X axis value of left side of the controller.doublegetLeftY()Get the Y axis value of left side of the controller.doubleGet the right trigger axis value of the controller.doubleGet the X axis value of right side of the controller.doubleGet the Y axis value of right side of the controller.edu.wpi.first.wpilibj2.command.button.TriggerConstructs a Trigger instance around the left bumper button's digital signal.edu.wpi.first.wpilibj2.command.button.TriggerleftBumper(edu.wpi.first.wpilibj.event.EventLoop loop) Constructs a Trigger instance around the left bumper button's digital signal.edu.wpi.first.wpilibj2.command.button.TriggerConstructs a Trigger instance around the left stick button's digital signal.edu.wpi.first.wpilibj2.command.button.TriggerleftStick(edu.wpi.first.wpilibj.event.EventLoop loop) Constructs a Trigger instance around the left stick button's digital signal.edu.wpi.first.wpilibj2.command.button.TriggerConstructs a Trigger instance around the axis value of the left trigger.edu.wpi.first.wpilibj2.command.button.TriggerleftTrigger(double threshold) Constructs a Trigger instance around the axis value of the left trigger.edu.wpi.first.wpilibj2.command.button.TriggerleftTrigger(double threshold, edu.wpi.first.wpilibj.event.EventLoop loop) Constructs a Trigger instance around the axis value of the left trigger.edu.wpi.first.wpilibj2.command.button.Triggerpov(int angle) Constructs a Trigger instance based around this angle of the default (index 0) POV on the HID, attached tothe default command scheduler button loop.edu.wpi.first.wpilibj2.command.button.Triggerpov(int pov, int angle, edu.wpi.first.wpilibj.event.EventLoop loop) Constructs a Trigger instance based around this angle of a POV on the HID.edu.wpi.first.wpilibj2.command.button.TriggerConstructs a Trigger instance based around the center (not pressed) position of the default (index 0) POV on the HID, attached tothe default command scheduler button loop.edu.wpi.first.wpilibj2.command.button.TriggerpovDown()Constructs a Trigger instance based around the 180 degree angle (down) of the default (index 0) POV on the HID, attached tothe default command scheduler button loop.edu.wpi.first.wpilibj2.command.button.TriggerConstructs a Trigger instance based around the 225 degree angle (down left) of the default (index 0) POV on the HID, attached tothe default command scheduler button loop.edu.wpi.first.wpilibj2.command.button.TriggerConstructs a Trigger instance based around the 135 degree angle (right down) of the default (index 0) POV on the HID, attached tothe default command scheduler button loop.edu.wpi.first.wpilibj2.command.button.TriggerpovLeft()Constructs a Trigger instance based around the 270 degree angle (left) of the default (index 0) POV on the HID, attached tothe default command scheduler button loop.edu.wpi.first.wpilibj2.command.button.TriggerpovRight()Constructs a Trigger instance based around the 90 degree angle (right) of the default (index 0) POV on the HID, attached tothe default command scheduler button loop.edu.wpi.first.wpilibj2.command.button.TriggerpovUp()Constructs a Trigger instance based around the 0 degree angle (up) of the default (index 0) POV on the HID, attached tothe default command scheduler button loop.edu.wpi.first.wpilibj2.command.button.TriggerConstructs a Trigger instance based around the 315 degree angle (left up) of the default (index 0) POV on the HID, attached tothe default command scheduler button loop.edu.wpi.first.wpilibj2.command.button.TriggerConstructs a Trigger instance based around the 45 degree angle (right up) of the default (index 0) POV on the HID, attached tothe default command scheduler button loop.edu.wpi.first.wpilibj2.command.button.TriggerConstructs a Trigger instance around the right bumper button's digital signal.edu.wpi.first.wpilibj2.command.button.TriggerrightBumper(edu.wpi.first.wpilibj.event.EventLoop loop) Constructs a Trigger instance around the right bumper button's digital signal.edu.wpi.first.wpilibj2.command.button.TriggerConstructs a Trigger instance around the right stick button's digital signal.edu.wpi.first.wpilibj2.command.button.TriggerrightStick(edu.wpi.first.wpilibj.event.EventLoop loop) Constructs a Trigger instance around the right stick button's digital signal.edu.wpi.first.wpilibj2.command.button.TriggerConstructs a Trigger instance around the axis value of the right trigger.edu.wpi.first.wpilibj2.command.button.TriggerrightTrigger(double threshold) Constructs a Trigger instance around the axis value of the right trigger.edu.wpi.first.wpilibj2.command.button.TriggerrightTrigger(double threshold, edu.wpi.first.wpilibj.event.EventLoop loop) Constructs a Trigger instance around the axis value of the right trigger.edu.wpi.first.wpilibj2.command.button.Triggerstart()Constructs a Trigger instance around the start button's digital signal.edu.wpi.first.wpilibj2.command.button.Triggerstart(edu.wpi.first.wpilibj.event.EventLoop loop) Constructs a Trigger instance around the start button's digital signal.edu.wpi.first.wpilibj2.command.button.Triggerx()Constructs a Trigger instance around the X button's digital signal.edu.wpi.first.wpilibj2.command.button.Triggerx(edu.wpi.first.wpilibj.event.EventLoop loop) Constructs a Trigger instance around the X button's digital signal.edu.wpi.first.wpilibj2.command.button.Triggery()Constructs a Trigger instance around the Y button's digital signal.edu.wpi.first.wpilibj2.command.button.Triggery(edu.wpi.first.wpilibj.event.EventLoop loop) Constructs a Trigger instance around the Y button's digital signal.
-
Constructor Details
-
PARTsCommandController
public PARTsCommandController(int port, boolean disableAutomaticDetection) -
PARTsCommandController
-
-
Method Details
-
a
public edu.wpi.first.wpilibj2.command.button.Trigger a()Constructs a Trigger instance around the A button's digital signal.- Returns:
- a Trigger instance representing the A button's digital signal attached to the
default scheduler button loop. - See Also:
-
a
public edu.wpi.first.wpilibj2.command.button.Trigger a(edu.wpi.first.wpilibj.event.EventLoop loop) Constructs a Trigger instance around the A button's digital signal.- Parameters:
loop- the event loop instance to attach the event to.- Returns:
- a Trigger instance representing the A button's digital signal attached to the given loop.
-
b
public edu.wpi.first.wpilibj2.command.button.Trigger b()Constructs a Trigger instance around the B button's digital signal.- Returns:
- a Trigger instance representing the B button's digital signal attached to the
default scheduler button loop. - See Also:
-
b
public edu.wpi.first.wpilibj2.command.button.Trigger b(edu.wpi.first.wpilibj.event.EventLoop loop) Constructs a Trigger instance around the B button's digital signal.- Parameters:
loop- the event loop instance to attach the event to.- Returns:
- a Trigger instance representing the B button's digital signal attached to the given loop.
-
x
public edu.wpi.first.wpilibj2.command.button.Trigger x()Constructs a Trigger instance around the X button's digital signal.- Returns:
- a Trigger instance representing the X button's digital signal attached to the
default scheduler button loop. - See Also:
-
x
public edu.wpi.first.wpilibj2.command.button.Trigger x(edu.wpi.first.wpilibj.event.EventLoop loop) Constructs a Trigger instance around the X button's digital signal.- Parameters:
loop- the event loop instance to attach the event to.- Returns:
- a Trigger instance representing the X button's digital signal attached to the given loop.
-
y
public edu.wpi.first.wpilibj2.command.button.Trigger y()Constructs a Trigger instance around the Y button's digital signal.- Returns:
- a Trigger instance representing the Y button's digital signal attached to the
default scheduler button loop. - See Also:
-
y
public edu.wpi.first.wpilibj2.command.button.Trigger y(edu.wpi.first.wpilibj.event.EventLoop loop) Constructs a Trigger instance around the Y button's digital signal.- Parameters:
loop- the event loop instance to attach the event to.- Returns:
- a Trigger instance representing the Y button's digital signal attached to the given loop.
-
leftBumper
public edu.wpi.first.wpilibj2.command.button.Trigger leftBumper()Constructs a Trigger instance around the left bumper button's digital signal.- Returns:
- a Trigger instance representing the left bumper button's digital signal attached to
the
default scheduler button loop. - See Also:
-
leftBumper
public edu.wpi.first.wpilibj2.command.button.Trigger leftBumper(edu.wpi.first.wpilibj.event.EventLoop loop) Constructs a Trigger instance around the left bumper button's digital signal.- Parameters:
loop- the event loop instance to attach the event to.- Returns:
- a Trigger instance representing the left bumper button's digital signal attached to the given loop.
-
rightBumper
public edu.wpi.first.wpilibj2.command.button.Trigger rightBumper()Constructs a Trigger instance around the right bumper button's digital signal.- Returns:
- a Trigger instance representing the right bumper button's digital signal attached to
the
default scheduler button loop. - See Also:
-
rightBumper
public edu.wpi.first.wpilibj2.command.button.Trigger rightBumper(edu.wpi.first.wpilibj.event.EventLoop loop) Constructs a Trigger instance around the right bumper button's digital signal.- Parameters:
loop- the event loop instance to attach the event to.- Returns:
- a Trigger instance representing the right bumper button's digital signal attached to the given loop.
-
back
public edu.wpi.first.wpilibj2.command.button.Trigger back()Constructs a Trigger instance around the back button's digital signal.- Returns:
- a Trigger instance representing the back button's digital signal attached to the
default scheduler button loop. - See Also:
-
back
public edu.wpi.first.wpilibj2.command.button.Trigger back(edu.wpi.first.wpilibj.event.EventLoop loop) Constructs a Trigger instance around the back button's digital signal.- Parameters:
loop- the event loop instance to attach the event to.- Returns:
- a Trigger instance representing the back button's digital signal attached to the given loop.
-
start
public edu.wpi.first.wpilibj2.command.button.Trigger start()Constructs a Trigger instance around the start button's digital signal.- Returns:
- a Trigger instance representing the start button's digital signal attached to the
default scheduler button loop. - See Also:
-
start
public edu.wpi.first.wpilibj2.command.button.Trigger start(edu.wpi.first.wpilibj.event.EventLoop loop) Constructs a Trigger instance around the start button's digital signal.- Parameters:
loop- the event loop instance to attach the event to.- Returns:
- a Trigger instance representing the start button's digital signal attached to the given loop.
-
leftStick
public edu.wpi.first.wpilibj2.command.button.Trigger leftStick()Constructs a Trigger instance around the left stick button's digital signal.- Returns:
- a Trigger instance representing the left stick button's digital signal attached to
the
default scheduler button loop. - See Also:
-
leftStick
public edu.wpi.first.wpilibj2.command.button.Trigger leftStick(edu.wpi.first.wpilibj.event.EventLoop loop) Constructs a Trigger instance around the left stick button's digital signal.- Parameters:
loop- the event loop instance to attach the event to.- Returns:
- a Trigger instance representing the left stick button's digital signal attached to the given loop.
-
rightStick
public edu.wpi.first.wpilibj2.command.button.Trigger rightStick()Constructs a Trigger instance around the right stick button's digital signal.- Returns:
- a Trigger instance representing the right stick button's digital signal attached to
the
default scheduler button loop. - See Also:
-
rightStick
public edu.wpi.first.wpilibj2.command.button.Trigger rightStick(edu.wpi.first.wpilibj.event.EventLoop loop) Constructs a Trigger instance around the right stick button's digital signal.- Parameters:
loop- the event loop instance to attach the event to.- Returns:
- a Trigger instance representing the right stick button's digital signal attached to the given loop.
-
leftTrigger
public edu.wpi.first.wpilibj2.command.button.Trigger leftTrigger(double threshold, edu.wpi.first.wpilibj.event.EventLoop loop) Constructs a Trigger instance around the axis value of the left trigger. The returned trigger will be true when the axis value is greater thanthreshold.- Parameters:
threshold- the minimum axis value for the returnedTriggerto be true. This value should be in the range [0, 1] where 0 is the unpressed state of the axis.loop- the event loop instance to attach the Trigger to.- Returns:
- a Trigger instance that is true when the left trigger's axis exceeds the provided threshold, attached to the given event loop
-
leftTrigger
public edu.wpi.first.wpilibj2.command.button.Trigger leftTrigger(double threshold) Constructs a Trigger instance around the axis value of the left trigger. The returned trigger will be true when the axis value is greater thanthreshold.- Parameters:
threshold- the minimum axis value for the returnedTriggerto be true. This value should be in the range [0, 1] where 0 is the unpressed state of the axis.- Returns:
- a Trigger instance that is true when the left trigger's axis exceeds the provided
threshold, attached to the
default scheduler button loop.
-
leftTrigger
public edu.wpi.first.wpilibj2.command.button.Trigger leftTrigger()Constructs a Trigger instance around the axis value of the left trigger. The returned trigger will be true when the axis value is greater than 0.5.- Returns:
- a Trigger instance that is true when the left trigger's axis exceeds 0.5, attached to
the
default scheduler button loop.
-
rightTrigger
public edu.wpi.first.wpilibj2.command.button.Trigger rightTrigger(double threshold, edu.wpi.first.wpilibj.event.EventLoop loop) Constructs a Trigger instance around the axis value of the right trigger. The returned trigger will be true when the axis value is greater thanthreshold.- Parameters:
threshold- the minimum axis value for the returnedTriggerto be true. This value should be in the range [0, 1] where 0 is the unpressed state of the axis.loop- the event loop instance to attach the Trigger to.- Returns:
- a Trigger instance that is true when the right trigger's axis exceeds the provided threshold, attached to the given event loop
-
rightTrigger
public edu.wpi.first.wpilibj2.command.button.Trigger rightTrigger(double threshold) Constructs a Trigger instance around the axis value of the right trigger. The returned trigger will be true when the axis value is greater thanthreshold.- Parameters:
threshold- the minimum axis value for the returnedTriggerto be true. This value should be in the range [0, 1] where 0 is the unpressed state of the axis.- Returns:
- a Trigger instance that is true when the right trigger's axis exceeds the provided
threshold, attached to the
default scheduler button loop.
-
rightTrigger
public edu.wpi.first.wpilibj2.command.button.Trigger rightTrigger()Constructs a Trigger instance around the axis value of the right trigger. The returned trigger will be true when the axis value is greater than 0.5.- Returns:
- a Trigger instance that is true when the right trigger's axis exceeds 0.5, attached
to the
default scheduler button loop.
-
getLeftX
public double getLeftX()Get the X axis value of left side of the controller. Right is positive.- Returns:
- The axis value.
-
getRightX
public double getRightX()Get the X axis value of right side of the controller. Right is positive.- Returns:
- The axis value.
-
getLeftY
public double getLeftY()Get the Y axis value of left side of the controller. Back is positive.- Returns:
- The axis value.
-
getRightY
public double getRightY()Get the Y axis value of right side of the controller. Back is positive.- Returns:
- The axis value.
-
getLeftTriggerAxis
public double getLeftTriggerAxis()Get the left trigger axis value of the controller. Note that this axis is bound to the range of [0, 1] as opposed to the usual [-1, 1].- Returns:
- The axis value.
-
getRightTriggerAxis
public double getRightTriggerAxis()Get the right trigger axis value of the controller. Note that this axis is bound to the range of [0, 1] as opposed to the usual [-1, 1].- Returns:
- The axis value.
-
pov
public edu.wpi.first.wpilibj2.command.button.Trigger pov(int angle) Constructs a Trigger instance based around this angle of the default (index 0) POV on the HID, attached tothe default command scheduler button loop.The POV angles start at 0 in the up direction, and increase clockwise (e.g. right is 90, upper-left is 315).
- Parameters:
angle- POV angle in degrees, or -1 for the center / not pressed.- Returns:
- a Trigger instance based around this angle of a POV on the HID.
-
pov
public edu.wpi.first.wpilibj2.command.button.Trigger pov(int pov, int angle, edu.wpi.first.wpilibj.event.EventLoop loop) Constructs a Trigger instance based around this angle of a POV on the HID.The POV angles start at 0 in the up direction, and increase clockwise (e.g. right is 90, upper-left is 315).
- Parameters:
pov- index of the POV to read (starting at 0). Defaults to 0.angle- POV angle in degrees, or -1 for the center / not pressed.loop- the event loop instance to attach the event to. Defaults tothe default command scheduler button loop.- Returns:
- a Trigger instance based around this angle of a POV on the HID.
-
povUp
public edu.wpi.first.wpilibj2.command.button.Trigger povUp()Constructs a Trigger instance based around the 0 degree angle (up) of the default (index 0) POV on the HID, attached tothe default command scheduler button loop.- Returns:
- a Trigger instance based around the 0 degree angle of a POV on the HID.
-
povUpRight
public edu.wpi.first.wpilibj2.command.button.Trigger povUpRight()Constructs a Trigger instance based around the 45 degree angle (right up) of the default (index 0) POV on the HID, attached tothe default command scheduler button loop.- Returns:
- a Trigger instance based around the 45 degree angle of a POV on the HID.
-
povRight
public edu.wpi.first.wpilibj2.command.button.Trigger povRight()Constructs a Trigger instance based around the 90 degree angle (right) of the default (index 0) POV on the HID, attached tothe default command scheduler button loop.- Returns:
- a Trigger instance based around the 90 degree angle of a POV on the HID.
-
povDownRight
public edu.wpi.first.wpilibj2.command.button.Trigger povDownRight()Constructs a Trigger instance based around the 135 degree angle (right down) of the default (index 0) POV on the HID, attached tothe default command scheduler button loop.- Returns:
- a Trigger instance based around the 135 degree angle of a POV on the HID.
-
povDown
public edu.wpi.first.wpilibj2.command.button.Trigger povDown()Constructs a Trigger instance based around the 180 degree angle (down) of the default (index 0) POV on the HID, attached tothe default command scheduler button loop.- Returns:
- a Trigger instance based around the 180 degree angle of a POV on the HID.
-
povDownLeft
public edu.wpi.first.wpilibj2.command.button.Trigger povDownLeft()Constructs a Trigger instance based around the 225 degree angle (down left) of the default (index 0) POV on the HID, attached tothe default command scheduler button loop.- Returns:
- a Trigger instance based around the 225 degree angle of a POV on the HID.
-
povLeft
public edu.wpi.first.wpilibj2.command.button.Trigger povLeft()Constructs a Trigger instance based around the 270 degree angle (left) of the default (index 0) POV on the HID, attached tothe default command scheduler button loop.- Returns:
- a Trigger instance based around the 270 degree angle of a POV on the HID.
-
povUpLeft
public edu.wpi.first.wpilibj2.command.button.Trigger povUpLeft()Constructs a Trigger instance based around the 315 degree angle (left up) of the default (index 0) POV on the HID, attached tothe default command scheduler button loop.- Returns:
- a Trigger instance based around the 315 degree angle of a POV on the HID.
-
povCenter
public edu.wpi.first.wpilibj2.command.button.Trigger povCenter()Constructs a Trigger instance based around the center (not pressed) position of the default (index 0) POV on the HID, attached tothe default command scheduler button loop.- Returns:
- a Trigger instance based around the center position of a POV on the HID.
-
axisLessThan
public edu.wpi.first.wpilibj2.command.button.Trigger axisLessThan(int axis, double threshold) Constructs a Trigger instance that is true when the axis value is less thanthreshold, attached tothe default command scheduler button loop.- Parameters:
axis- The axis to read, starting at 0threshold- The value below which this trigger should return true.- Returns:
- a Trigger instance that is true when the axis value is less than the provided threshold.
-
axisLessThan
public edu.wpi.first.wpilibj2.command.button.Trigger axisLessThan(int axis, double threshold, edu.wpi.first.wpilibj.event.EventLoop loop) Constructs a Trigger instance that is true when the axis value is less thanthreshold, attached to the given loop.- Parameters:
axis- The axis to read, starting at 0threshold- The value below which this trigger should return true.loop- the event loop instance to attach the trigger to- Returns:
- a Trigger instance that is true when the axis value is less than the provided threshold.
-
axisGreaterThan
public edu.wpi.first.wpilibj2.command.button.Trigger axisGreaterThan(int axis, double threshold) Constructs a Trigger instance that is true when the axis value is less thanthreshold, attached tothe default command scheduler button loop.- Parameters:
axis- The axis to read, starting at 0threshold- The value above which this trigger should return true.- Returns:
- a Trigger instance that is true when the axis value is greater than the provided threshold.
-
axisGreaterThan
public edu.wpi.first.wpilibj2.command.button.Trigger axisGreaterThan(int axis, double threshold, edu.wpi.first.wpilibj.event.EventLoop loop) Constructs a Trigger instance that is true when the axis value is greater thanthreshold, attached to the given loop.- Parameters:
axis- The axis to read, starting at 0threshold- The value above which this trigger should return true.loop- the event loop instance to attach the trigger to.- Returns:
- a Trigger instance that is true when the axis value is greater than the provided threshold.
-
axisMagnitudeGreaterThan
public edu.wpi.first.wpilibj2.command.button.Trigger axisMagnitudeGreaterThan(int axis, double threshold, edu.wpi.first.wpilibj.event.EventLoop loop) Constructs a Trigger instance that is true when the axis magnitude value is greater thanthreshold, attached to the given loop.- Parameters:
axis- The axis to read, starting at 0threshold- The value above which this trigger should return true.loop- the event loop instance to attach the trigger to.- Returns:
- a Trigger instance that is true when the axis magnitude value is greater than the provided threshold.
-
axisMagnitudeGreaterThan
public edu.wpi.first.wpilibj2.command.button.Trigger axisMagnitudeGreaterThan(int axis, double threshold) Constructs a Trigger instance that is true when the axis magnitude value is greater thanthreshold, attached tothe default command scheduler button loop.- Parameters:
axis- The axis to read, starting at 0threshold- The value above which this trigger should return true.- Returns:
- a Trigger instance that is true when the deadbanded axis value is active (non-zero).
-