Package com.marslib.swerve
Class SwerveAutoBuilder
java.lang.Object
com.marslib.swerve.SwerveAutoBuilder
Encapsulates the static configurations for PathPlanner's AutoBuilder. Kept independent from the
main drivetrain subsystem to allow headless mock testing.
-
Method Summary
Modifier and TypeMethodDescriptionstatic edu.wpi.first.wpilibj2.command.CommandalignToPoint(SwerveDrive drive, Supplier<edu.wpi.first.math.geometry.Pose2d> target) Generates a command that automatically paths the robot to the specified target utilizing PathPlanner's physics-constrained solver to avoid field obstacles dynamically.static voidconfigure(SwerveDrive drive) Configures PathPlanner's AutoBuilder for autonomous path following.
-
Method Details
-
configure
Configures PathPlanner's AutoBuilder for autonomous path following.- Parameters:
drive- The SwerveDrive subsystem instance for method references and command requirements.
-
alignToPoint
public static edu.wpi.first.wpilibj2.command.Command alignToPoint(SwerveDrive drive, Supplier<edu.wpi.first.math.geometry.Pose2d> target) Generates a command that automatically paths the robot to the specified target utilizing PathPlanner's physics-constrained solver to avoid field obstacles dynamically.- Parameters:
drive- The SwerveDrive logictarget- A supplier of the absolute field pose to navigate to.- Returns:
- A Command orchestrating the autonomous drive.
-