]> git.taranathan.com Git - FRC2026.git/commitdiff
Update TurretJoyStickAim.java
authormixxlto <maxtan0626@gmail.com>
Thu, 22 Jan 2026 00:40:05 +0000 (16:40 -0800)
committermixxlto <maxtan0626@gmail.com>
Thu, 22 Jan 2026 00:40:05 +0000 (16:40 -0800)
src/main/java/frc/robot/commands/gpm/TurretJoyStickAim.java

index 4722dd0e7b61a1b784b19b2db634eebeaa2df2cb..a383128ea655ceccae7451f1aa105a80ecd756ed 100644 (file)
@@ -1,16 +1,26 @@
 package frc.robot.commands.gpm;
 
+import edu.wpi.first.math.geometry.Rotation2d;
+import edu.wpi.first.math.util.Units;
 import edu.wpi.first.wpilibj2.command.Command;
+import frc.robot.controls.BaseDriverConfig;
 import frc.robot.subsystems.drivetrain.Drivetrain;
 import frc.robot.subsystems.turret.Turret;
 
 public class TurretJoyStickAim extends Command{
     private Turret turret;
+    private BaseDriverConfig driver;
 
     public TurretJoyStickAim(Turret turret){
         this.turret = turret;
     }
 
-    Rotation2d desiredAngle = new Rotation2d(-driver.getRawSideTranslation(), driver.getRawForwardTranslation()); //this feels better
+    Rotation2d rotation2d = new Rotation2d(driver.getRawSideTranslation(), driver.getRawForwardTranslation());
+    double angle = Units.radiansToDegrees(rotation2d.getDegrees());
+
+    @Override
+    public void execute() {
+        turret.setSetpoint(angle, 0);
+    }
 
 }