Class SmartAssistAlign

java.lang.Object
edu.wpi.first.wpilibj2.command.Command
com.marslib.auto.SmartAssistAlign
All Implemented Interfaces:
edu.wpi.first.util.sendable.Sendable

public class SmartAssistAlign extends edu.wpi.first.wpilibj2.command.Command
Command for dynamic, odometry-based robot alignment specifically for scoring on standard FRC grid nodes.
  • Nested Class Summary

    Nested classes/interfaces inherited from class edu.wpi.first.wpilibj2.command.Command

    edu.wpi.first.wpilibj2.command.Command.InterruptionBehavior
  • Constructor Summary

    Constructors
    Constructor
    Description
    SmartAssistAlign(SwerveDrive swerveDrive, DoubleSupplier forwardThrottleSupplier, edu.wpi.first.math.geometry.Pose2d targetNode)
    Overrides the driver's lateral (Y) and rotational (Theta) control to perfectly track a specific field coordinate, while allowing them to maintain forward/backward (X) speed.
  • Method Summary

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

    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, initialize, initSendable, 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

    • SmartAssistAlign

      public SmartAssistAlign(SwerveDrive swerveDrive, DoubleSupplier forwardThrottleSupplier, edu.wpi.first.math.geometry.Pose2d targetNode)
      Overrides the driver's lateral (Y) and rotational (Theta) control to perfectly track a specific field coordinate, while allowing them to maintain forward/backward (X) speed.
      Parameters:
      swerveDrive - Standard drive subsystem hook.
      forwardThrottleSupplier - Lambda to the driver's X-axis joystick input.
      targetNode - The stationary coordinate mapping we want to align to.
  • Method Details

    • 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