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

public class MoveFieldManualCommand extends AbstractSubsystemCommand<DriveBaseSubsystem>
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

    Constructors
    Constructor
    Description
    MoveFieldManualCommand(DriveBaseSubsystem driveBaseSubsystem, DoubleSupplier forwardMetersPerSecondSupplier, DoubleSupplier leftMetersPerSecondSupplier, DoubleSupplier ccwRadiansPerSecondSupplier)
    Creates a manual drive command that issues field-relative chassis speeds.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    end(boolean interrupted)
    Stops and locks the drivebase once manual control ends or is interrupted.
    void
    Continuously drives the robot using the supplied field-relative speed requests.
    protected void
    Clears any pose targets so manual control can fully own the drivebase.

    Methods inherited from class frc.robot.shared.commands.AbstractSubsystemCommand

    initialize

    Methods 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 command
      forwardMetersPerSecondSupplier - supplier providing forward (positive X) velocity in meters per second
      leftMetersPerSecondSupplier - supplier providing leftward (positive Y) velocity in meters per second
      ccwRadiansPerSecondSupplier - 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:
      execute in class edu.wpi.first.wpilibj2.command.Command
    • end

      public void end(boolean interrupted)
      Stops and locks the drivebase once manual control ends or is interrupted.
      Overrides:
      end in class edu.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:
      onInitialize in class AbstractSubsystemCommand<DriveBaseSubsystem>