From 349bd95e8bef6ce9a360979c3c4dc0f182eec291 Mon Sep 17 00:00:00 2001 From: mixxlto Date: Wed, 21 Jan 2026 16:40:05 -0800 Subject: [PATCH] Update TurretJoyStickAim.java --- .../frc/robot/commands/gpm/TurretJoyStickAim.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/frc/robot/commands/gpm/TurretJoyStickAim.java b/src/main/java/frc/robot/commands/gpm/TurretJoyStickAim.java index 4722dd0..a383128 100644 --- a/src/main/java/frc/robot/commands/gpm/TurretJoyStickAim.java +++ b/src/main/java/frc/robot/commands/gpm/TurretJoyStickAim.java @@ -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); + } } -- 2.39.5