mirror of
https://github.com/Team4388/2026KPopRobotHunters.git
synced 2026-06-09 00:38:03 -06:00
Move AimLeadTime to being defined by ShooterConstants.
This commit is contained in:
@@ -24,6 +24,7 @@ public class ShooterConstants {
|
||||
public static final ConfigurableDouble INDEXER_FORWARD_OUTPUT = new ConfigurableDouble("Indexer FWD % Output", -0.1);
|
||||
public static final ConfigurableDouble INDEXER_REVERSE_OUTPUT = new ConfigurableDouble("Indexer reverse % Output", 0.0);
|
||||
|
||||
public static final ConfigurableDouble AIM_LEAD_TIME = new ConfigurableDouble("Aim lead time", 0);
|
||||
|
||||
// Shoot mode tolerances
|
||||
public static final ConfigurableDouble ROBOT_MIN_HUB = new ConfigurableDouble("Shoot min dist M", 0);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -39,9 +39,6 @@ public final class SwerveDriveConstants {
|
||||
public static double PLAYBACK_ROTATION_SPEED = AUTO_MAX_ROT_SPEED;
|
||||
public static double ROT_CORRECTION_SPEED = 10; // MIN_ROT_SPEED;
|
||||
|
||||
// TODO: Replace with a constant
|
||||
public static final ConfigurableDouble AIM_LEAD_TIME = new ConfigurableDouble("Aim lead time", 0);
|
||||
|
||||
public static final double CORRECTION_MIN = 10;
|
||||
public static final double CORRECTION_MAX = 50;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user