Package ftclib.driverio
Class FtcGamepadRumble
This class implements a platform dependent priority indicator device using gamepad rumble. It provides platform
dependent methods that gets/sets the rumble pattern from/to the device.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
This class contains information about a rumble pattern. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate FtcGamepadRumble.Pattern
private final com.qualcomm.robotcore.hardware.Gamepad
Fields inherited from class trclib.driverio.TrcPriorityIndicator
instanceName, tracer
-
Constructor Summary
ConstructorsConstructorDescriptionFtcGamepadRumble
(String instanceName, com.qualcomm.robotcore.hardware.Gamepad gamepad) Constructor: Create an instance of the object. -
Method Summary
Modifier and TypeMethodDescriptionThis method gets the current set LED pattern.void
setBlips
(int count) This method rumble the gamepad for a certain number of "blips" using predetermined blip timing.void
setPattern
(FtcGamepadRumble.Pattern pattern) This method sets the LED pattern to the physical Gobilda Light Indicator device.void
setRumble
(double leftRumble, double rightRumble, double duration) This method rumble the gamepad at a fixed rumble power for a certain duration.Methods inherited from class trclib.driverio.TrcPriorityIndicator
getPatternPriority, getPatternState, getPatternState, printPatternPriorityTable, reset, resetAllPatternStates, setPatternPriorities, setPatternState, setPatternState, setPatternState, setPatternState, setPatternState, setPatternState, toString
-
Field Details
-
gamepad
private final com.qualcomm.robotcore.hardware.Gamepad gamepad -
currPattern
-
-
Constructor Details
-
FtcGamepadRumble
Constructor: Create an instance of the object.- Parameters:
instanceName
- specifies the instance name.gamepad
- specifies the gamepad for the rumble effect.
-
-
Method Details
-
setRumble
public void setRumble(double leftRumble, double rightRumble, double duration) This method rumble the gamepad at a fixed rumble power for a certain duration. Calling this will displace any currently running rumble effect.- Parameters:
leftRumble
- specifies rumble power for left rumble motor (0.0 - 1.0).rightRumble
- specifies rumble power for right rumble motor (0.0 - 1.0).duration
- specifies duration to rumble for in seconds, or -1 for continuous.
-
setBlips
public void setBlips(int count) This method rumble the gamepad for a certain number of "blips" using predetermined blip timing. This will displace any currently running rumble effect.- Parameters:
count
- specifies the number of rumble blips to perform.
-
getPattern
This method gets the current set LED pattern.- Specified by:
getPattern
in classTrcPriorityIndicator<FtcGamepadRumble.Pattern>
- Returns:
- currently set LED pattern.
-
setPattern
This method sets the LED pattern to the physical Gobilda Light Indicator device.- Specified by:
setPattern
in classTrcPriorityIndicator<FtcGamepadRumble.Pattern>
- Parameters:
pattern
- specifies the color pattern.
-