Move AimLeadTime to being defined by ShooterConstants.

This commit is contained in:
Michael Mikovsky
2026-02-20 15:24:05 -08:00
parent 803371e99d
commit 32ede81ffa
4 changed files with 7 additions and 6 deletions
@@ -339,7 +339,7 @@ public class SwerveDrive extends SubsystemBase implements Queryable {
// Drive with the robot facing towards a specific position
public void driveFacingPosition(Translation2d leftStick, Translation2d fieldPos) {
public void driveFacingPosition(Translation2d leftStick, Translation2d fieldPos, double aimLeadTime) {
// Get the current speed of the robot
Translation2d robotSpeed = new Translation2d(
@@ -348,7 +348,7 @@ public class SwerveDrive extends SubsystemBase implements Queryable {
);
// Calculate a point to aim ahead of the actual position.
Translation2d fieldPosLead = robotSpeed.times(SwerveDriveConstants.AIM_LEAD_TIME.get()).plus(fieldPos);
Translation2d fieldPosLead = robotSpeed.times(aimLeadTime).plus(fieldPos);
// Calculate the angle between the current position and the lead position
Rotation2d ang = fieldPosLead.minus(getPose2d().getTranslation()).getAngle();