Class AbsoluteDriveAdv

java.lang.Object
edu.wpi.first.wpilibj2.command.Command
frc.robot.commands.swervedrive.drivebase.AbsoluteDriveAdv
All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable

public class AbsoluteDriveAdv extends edu.wpi.first.wpilibj2.command.Command
A more advanced Swerve Control System that has 4 buttons for which direction to face
  • 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

    Constructors
    Constructor
    Description
    AbsoluteDriveAdv(SwerveSubsystem swerve, DoubleSupplier vX, DoubleSupplier vY, DoubleSupplier headingAdjust, BooleanSupplier lookAway, BooleanSupplier lookTowards, BooleanSupplier lookLeft, BooleanSupplier lookRight)
    Used to drive a swerve robot in full field-centric mode.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    end(boolean interrupted)
     
    void
     
    void
     
    boolean
     

    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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AbsoluteDriveAdv

      public AbsoluteDriveAdv(SwerveSubsystem swerve, DoubleSupplier vX, DoubleSupplier vY, DoubleSupplier headingAdjust, BooleanSupplier lookAway, BooleanSupplier lookTowards, BooleanSupplier lookLeft, BooleanSupplier lookRight)
      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. Heading Adjust changes the current heading after being multipied by a constant. The look booleans are shortcuts to get the robot to face a certian direction. Based off of ideas in https://www.chiefdelphi.com/t/experiments-with-a-swerve-steering-knob/446172
      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.
      headingAdjust - DoubleSupplier that supplies the component of the robot's heading angle that should be adjusted. Should range from -1 to 1 with deadband already accounted for.
      lookAway - Face the robot towards the opposing alliance's wall in the same direction the driver is facing
      lookTowards - Face the robot towards the driver
      lookLeft - Face the robot left
      lookRight - Face the robot right
  • Method Details

    • initialize

      public void initialize()
      Overrides:
      initialize in class edu.wpi.first.wpilibj2.command.Command
    • execute

      public void execute()
      Overrides:
      execute in class edu.wpi.first.wpilibj2.command.Command
    • end

      public void end(boolean interrupted)
      Overrides:
      end in class edu.wpi.first.wpilibj2.command.Command
    • isFinished

      public boolean isFinished()
      Overrides:
      isFinished in class edu.wpi.first.wpilibj2.command.Command