From: mixxlto Date: Thu, 22 Jan 2026 00:40:05 +0000 (-0800) Subject: Update TurretJoyStickAim.java X-Git-Url: https://git.taranathan.com/?a=commitdiff_plain;h=349bd95e8bef6ce9a360979c3c4dc0f182eec291;p=FRC2026.git Update TurretJoyStickAim.java --- 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); + } }