Class MoveFieldManualCommand
java.lang.Object
edu.wpi.first.wpilibj2.command.Command
frc.robot.shared.commands.AbstractSubsystemCommand<DriveBaseSubsystem>
frc.robot.subsystems.drivebase.commands.MoveFieldManualCommand
- All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable
Drives the robot field-relative using continuously supplied chassis speeds. Forward/left translation and counter-clockwise rotation requests
typically come from driver controls.
-
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 frc.robot.shared.commands.AbstractSubsystemCommand
log, subsystem -
Constructor Summary
ConstructorsConstructorDescriptionMoveFieldManualCommand(DriveBaseSubsystem driveBaseSubsystem, DoubleSupplier forwardMetersPerSecondSupplier, DoubleSupplier leftMetersPerSecondSupplier, DoubleSupplier ccwRadiansPerSecondSupplier) Creates a manual drive command that issues field-relative chassis speeds. -
Method Summary
Modifier and TypeMethodDescriptionvoidend(boolean interrupted) Stops and locks the drivebase once manual control ends or is interrupted.voidexecute()Continuously drives the robot using the supplied field-relative speed requests.protected voidClears any pose targets so manual control can fully own the drivebase.Methods inherited from class frc.robot.shared.commands.AbstractSubsystemCommand
initializeMethods inherited from class edu.wpi.first.wpilibj2.command.Command
addRequirements, addRequirements, alongWith, andThen, andThen, asProxy, beforeStarting, beforeStarting, cancel, deadlineFor, deadlineWith, finallyDo, finallyDo, getInterruptionBehavior, getName, getRequirements, getSubsystem, handleInterrupt, hasRequirement, ignoringDisable, initSendable, isFinished, isScheduled, onlyIf, onlyWhile, raceWith, repeatedly, runsWhenDisabled, schedule, setName, setSubsystem, unless, until, withDeadline, withInterruptBehavior, withName, withTimeout, withTimeout
-
Constructor Details
-
MoveFieldManualCommand
public MoveFieldManualCommand(DriveBaseSubsystem driveBaseSubsystem, DoubleSupplier forwardMetersPerSecondSupplier, DoubleSupplier leftMetersPerSecondSupplier, DoubleSupplier ccwRadiansPerSecondSupplier) Creates a manual drive command that issues field-relative chassis speeds.- Parameters:
driveBaseSubsystem- drive base subsystem to commandforwardMetersPerSecondSupplier- supplier providing forward (positive X) velocity in meters per secondleftMetersPerSecondSupplier- supplier providing leftward (positive Y) velocity in meters per secondccwRadiansPerSecondSupplier- supplier providing counter-clockwise angular velocity in radians per second
-
-
Method Details
-
execute
public void execute()Continuously drives the robot using the supplied field-relative speed requests.- Overrides:
executein classedu.wpi.first.wpilibj2.command.Command
-
end
public void end(boolean interrupted) Stops and locks the drivebase once manual control ends or is interrupted.- Overrides:
endin classedu.wpi.first.wpilibj2.command.Command- Parameters:
interrupted- true when the command was cancelled before normal completion
-
onInitialize
protected void onInitialize()Clears any pose targets so manual control can fully own the drivebase.- Overrides:
onInitializein classAbstractSubsystemCommand<DriveBaseSubsystem>
-