Package frc.team4373.swerve.commands
Class SwerveDriveWithJoystick
- java.lang.Object
-
- edu.wpi.first.wpilibj.command.Command
-
- frc.team4373.swerve.commands.SwerveDriveWithJoystick
-
- All Implemented Interfaces:
edu.wpi.first.wpilibj.Sendable
,java.lang.AutoCloseable
public class SwerveDriveWithJoystick extends edu.wpi.first.wpilibj.command.Command
A default command for controlling a SwerveDrivetrain.
-
-
Constructor Summary
Constructors Constructor Description SwerveDriveWithJoystick(java.util.function.DoubleSupplier xGetter, java.util.function.DoubleSupplier yGetter, java.util.function.DoubleSupplier twistGetter, SwerveDrivetrain drivetrain)
Constructs a new SwerveDriveWithJoystick command.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
end()
protected void
execute()
protected void
initialize()
protected void
interrupted()
protected boolean
isFinished()
-
Methods inherited from class edu.wpi.first.wpilibj.command.Command
cancel, clearRequirements, close, doesRequire, getGroup, getName, getSubsystem, initSendable, isCanceled, isCompleted, isInterruptible, isRunning, isTimedOut, requires, setInterruptible, setName, setRunWhenDisabled, setSubsystem, setTimeout, start, timeSinceInitialized, toString, willRunWhenDisabled
-
-
-
-
Constructor Detail
-
SwerveDriveWithJoystick
public SwerveDriveWithJoystick(java.util.function.DoubleSupplier xGetter, java.util.function.DoubleSupplier yGetter, java.util.function.DoubleSupplier twistGetter, SwerveDrivetrain drivetrain)
Constructs a new SwerveDriveWithJoystick command.- Parameters:
xGetter
- a supplier of the x joystick input, [-1, 1].yGetter
- a supplier of the y joystick input, [-1, 1].twistGetter
- a supplier of the twist (z) joystick input, [-1, 1].drivetrain
- theSwerveDrivetrain
subsystem to drive.
-
-
Method Detail
-
initialize
protected void initialize()
- Overrides:
initialize
in classedu.wpi.first.wpilibj.command.Command
-
execute
protected void execute()
- Overrides:
execute
in classedu.wpi.first.wpilibj.command.Command
-
isFinished
protected boolean isFinished()
- Specified by:
isFinished
in classedu.wpi.first.wpilibj.command.Command
-
end
protected void end()
- Overrides:
end
in classedu.wpi.first.wpilibj.command.Command
-
interrupted
protected void interrupted()
- Overrides:
interrupted
in classedu.wpi.first.wpilibj.command.Command
-
-