]> git.taranathan.com Git - FRC2026.git/commitdiff
Merge remote-tracking branch 'origin/main' into shooter-calcs
authorArnav495 <arnieincyberland@gmail.com>
Tue, 24 Feb 2026 23:56:56 +0000 (15:56 -0800)
committerArnav495 <arnieincyberland@gmail.com>
Tue, 24 Feb 2026 23:56:56 +0000 (15:56 -0800)
1  2 
src/main/java/frc/robot/commands/gpm/AutoShootCommand.java

index 7b0e834f04d9078502d6d957d42a813910a28992,e12d054656cfaa9a109298e013caf5d23fd54775..14583ba7c5977bb6b3b668c271305efb2e47def5
@@@ -107,14 -106,12 +107,14 @@@ public class AutoShootCommand extends C
           */
          for (int i = 0; i < 20; i++) {
              Translation3d lookahead3d = new Translation3d(lookaheadPose.getX(), lookaheadPose.getY(), TurretConstants.DISTANCE_FROM_ROBOT_CENTER.getZ());
-             Translation3d target3d = new Translation3d(target.getX(), target.getY(), FieldConstants.getHubTranslation().getZ()); // Add if statement so that it's only when it's shooting
+             Translation3d target3d = new Translation3d(target.getX(), target.getY(), FieldConstants.getHubTranslation().getZ());
 -            goalState = ShooterPhysics.getShotParams(
 +            var goalStateWithT = ShooterPhysics.getShotParamsWithT(
 +                                      Translation2d.kZero,
                                target3d.minus(lookahead3d),
                                2.0);
 +                      goalState = goalStateWithT.getFirst();
  
 -            timeOfFlight = goalState.timeOfFlight();
 +            timeOfFlight = goalStateWithT.getSecond();
              double offsetX = turretVelocityX * timeOfFlight;
              double offsetY = turretVelocityY * timeOfFlight;
              lookaheadPose =