Skip to content

Commit

Permalink
added swerve into autoaim2
Browse files Browse the repository at this point in the history
  • Loading branch information
PGgit08 committed Mar 19, 2024
1 parent bc1873e commit 20a0232
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/commands/shooter/AutoAim2.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public AutoAim2(
DoubleSupplier xSpeed,
DoubleSupplier ySpeed
) {
this(swerve, shooter, elevator, xSpeed, ySpeed, () -> 0, shooter::speakerAngle, elevator::speakerHeight, false);
this(swerve, shooter, elevator, xSpeed, ySpeed, swerve::speakerHeading, shooter::speakerAngle, elevator::speakerHeight, false);
}

/**
Expand Down Expand Up @@ -100,7 +100,7 @@ public AutoAim2(
ShooterSubsystem shooter,
ElevatorSubsystem elevator
) {
this(swerve, shooter, elevator, () -> 0, () -> 0, () -> 0, shooter::speakerAngle, elevator::speakerHeight, true);
this(swerve, shooter, elevator, () -> 0, () -> 0, swerve::speakerHeading, shooter::speakerAngle, elevator::speakerHeight, true);
}

/**
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/frc/robot/subsystems/SwerveDriveSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,15 @@ public double[] speakerSetpoints() {
return offsets;
}

/**
* Get the calculated heading to aim the chassis at the speaker shot point.
*/
public double speakerHeading() {
Translation2d distance = shotVector();

return 0;
}

public void pivotMotor(Translation2d pivotPoint) {
_pivotPoint = pivotPoint;
}
Expand Down

0 comments on commit 20a0232

Please sign in to comment.