Class AbsoluteFieldDrive
java.lang.Object
edu.wpi.first.wpilibj2.command.Command
frc.robot.commands.swervedrive.drivebase.AbsoluteFieldDrive
- All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable
public class AbsoluteFieldDrive
extends edu.wpi.first.wpilibj2.command.Command
An example command that uses an example subsystem.
-
Nested Class Summary
Nested classes/interfaces inherited from class edu.wpi.first.wpilibj2.command.Command
edu.wpi.first.wpilibj2.command.Command.InterruptionBehavior -
Field Summary
Fields inherited from class edu.wpi.first.wpilibj2.command.Command
m_requirements -
Constructor Summary
ConstructorsConstructorDescriptionAbsoluteFieldDrive(SwerveSubsystem swerve, DoubleSupplier vX, DoubleSupplier vY, DoubleSupplier heading) Used to drive a swerve robot in full field-centric mode. -
Method Summary
Methods inherited from class edu.wpi.first.wpilibj2.command.Command
addRequirements, alongWith, andThen, andThen, asProxy, beforeStarting, beforeStarting, cancel, deadlineWith, finallyDo, finallyDo, getInterruptionBehavior, getName, getRequirements, getSubsystem, handleInterrupt, hasRequirement, ignoringDisable, initSendable, isScheduled, onlyIf, onlyWhile, raceWith, repeatedly, runsWhenDisabled, schedule, setName, setSubsystem, unless, until, withInterruptBehavior, withName, withTimeout
-
Constructor Details
-
AbsoluteFieldDrive
public AbsoluteFieldDrive(SwerveSubsystem swerve, DoubleSupplier vX, DoubleSupplier vY, DoubleSupplier heading) Used to drive a swerve robot in full field-centric mode. vX and vY supply translation inputs, where x is torwards/away from alliance wall and y is left/right. headingHorzontal and headingVertical are the Cartesian coordinates from which the robot's angle will be derived— they will be converted to a polar angle, which the robot will rotate to.- Parameters:
swerve- The swerve drivebase subsystem.vX- DoubleSupplier that supplies the x-translation joystick input. Should be in the range -1 to 1 with deadband already accounted for. Positive X is away from the alliance wall.vY- DoubleSupplier that supplies the y-translation joystick input. Should be in the range -1 to 1 with deadband already accounted for. Positive Y is towards the left wall when looking through the driver station glass.heading- DoubleSupplier that supplies the robot's heading angle.
-
-
Method Details
-
initialize
public void initialize()- Overrides:
initializein classedu.wpi.first.wpilibj2.command.Command
-
execute
public void execute()- Overrides:
executein classedu.wpi.first.wpilibj2.command.Command
-
end
public void end(boolean interrupted) - Overrides:
endin classedu.wpi.first.wpilibj2.command.Command
-
isFinished
public boolean isFinished()- Overrides:
isFinishedin classedu.wpi.first.wpilibj2.command.Command
-