Package frc.robot.commands
Class HapticCommand
java.lang.Object
edu.wpi.first.wpilibj2.command.Command
frc.robot.commands.HapticCommand
- All Implemented Interfaces:
Sendable
Triggers controller rumble for a specified amount of time.
-
Nested Class Summary
Nested classes/interfaces inherited from class edu.wpi.first.wpilibj2.command.Command
Command.InterruptionBehavior -
Constructor Summary
ConstructorsConstructorDescriptionHapticCommand(GenericHID controller, GenericHID.RumbleType type, double strength, Time duration) Creates a Command that triggers controller rumble for a specified amount of time.HapticCommand(CommandGenericHID controller, GenericHID.RumbleType type, double strength, Time duration) Creates a Command that triggers controller rumble for a specified amount of time. -
Method Summary
Methods inherited from class edu.wpi.first.wpilibj2.command.Command
addRequirements, addRequirements, alongWith, andThen, andThen, asProxy, beforeStarting, beforeStarting, cancel, deadlineFor, deadlineWith, execute, finallyDo, finallyDo, getInterruptionBehavior, getName, getRequirements, getSubsystem, handleInterrupt, hasRequirement, ignoringDisable, initSendable, isScheduled, onlyIf, onlyWhile, raceWith, repeatedly, schedule, setName, setSubsystem, unless, until, withDeadline, withInterruptBehavior, withName, withTimeout, withTimeout
-
Constructor Details
-
HapticCommand
public HapticCommand(GenericHID controller, GenericHID.RumbleType type, double strength, Time duration) Creates a Command that triggers controller rumble for a specified amount of time.- Parameters:
controller- Controller to rumble.type- Rumble type to set.strength- Rumble strength [0-1].duration- Rumble duration.
-
HapticCommand
public HapticCommand(CommandGenericHID controller, GenericHID.RumbleType type, double strength, Time duration) Creates a Command that triggers controller rumble for a specified amount of time.- Parameters:
controller- Controller to rumble.type- Rumble type to set.strength- Rumble strength [0-1].duration- Rumble duration.
-
-
Method Details
-
initialize
public void initialize()- Overrides:
initializein classCommand
-
end
public void end(boolean interrupted) -
isFinished
public boolean isFinished()- Overrides:
isFinishedin classCommand
-
runsWhenDisabled
public boolean runsWhenDisabled()- Overrides:
runsWhenDisabledin classCommand
-