From: WesleyWong-972 Date: Wed, 21 Jan 2026 01:21:57 +0000 (-0800) Subject: fdsa X-Git-Url: https://git.taranathan.com/?a=commitdiff_plain;h=b769793d37008dff6b7819dc3a64eacbdc5d643c;p=FRC2026.git fdsa --- diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 4ad3c92..36211e8 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -118,8 +118,6 @@ public class RobotContainer { LiveWindow.setEnabled(false); SmartDashboard.putData("Shutdown Orange Pis", new ShutdownAllPis()); - - } /** diff --git a/src/main/java/frc/robot/subsystems/turret/Turret.java b/src/main/java/frc/robot/subsystems/turret/Turret.java index a30def9..c1c043c 100644 --- a/src/main/java/frc/robot/subsystems/turret/Turret.java +++ b/src/main/java/frc/robot/subsystems/turret/Turret.java @@ -74,11 +74,6 @@ public class Turret extends SubsystemBase { motor.setNeutralMode(NeutralModeValue.Brake); TalonFXConfiguration config = new TalonFXConfiguration(); - CurrentLimitsConfigs limitConfig = new CurrentLimitsConfigs(); - limitConfig.StatorCurrentLimit = 200; - limitConfig.StatorCurrentLimitEnable = true; - - motor.getConfigurator().apply(limitConfig); // to be frank I just took this from hood because I don't know good values yet config.Slot0.kS = 0.1; // Static friction compensation (should be >0 if friction exists) @@ -151,7 +146,7 @@ public class Turret extends SubsystemBase { } public double getPosition() { - return motor.getPosition().getValueAsDouble() / gearRatio; // Gear ratio + return Units.rotationsToDegrees(motor.getPosition().getValueAsDouble()) / gearRatio; // Gear ratio } public boolean atSetPoint(){ @@ -181,7 +176,10 @@ public class Turret extends SubsystemBase { //Tune this with rotating robot double dV = TurretConstants.ROTATIONAL_VELOCITY_CONSTANT; - motor.setControl(voltageRequest.withPosition(motorTargetRotations).withFeedForward(dV * robotRotVel)); + //motor.setControl(voltageRequest.withPosition(motorTargetRotations).withFeedForward(dV * robotRotVel)); + motor.setControl(voltageRequest.withPosition(motorTargetRotations)); + + System.out.println("Workingnnnnngnggdsfadsfsa"); } } @@ -191,6 +189,8 @@ public class Turret extends SubsystemBase { velocity = Units.rotationsPerMinuteToRadiansPerSecond(motor.getVelocity().getValueAsDouble() * 60); ligament2d.setAngle(position); + + SmartDashboard.putNumber("Turret Position Degrees", getPosition()); } public double getAppliedVoltage() { diff --git a/src/main/java/frc/robot/subsystems/turret/TurretConstants.java b/src/main/java/frc/robot/subsystems/turret/TurretConstants.java index 569cc38..c163780 100644 --- a/src/main/java/frc/robot/subsystems/turret/TurretConstants.java +++ b/src/main/java/frc/robot/subsystems/turret/TurretConstants.java @@ -6,7 +6,7 @@ public class TurretConstants { public static double MAX_ANGLE = 180; public static double MIN_ANGLE = -180; - public static double MAX_VELOCITY = 0.1; // m/s + public static double MAX_VELOCITY = 1.0; // m/s public static double MAX_ACCELERATION = 5; // m/s^2 public static double TURRET_WIDTH = Units.feetToMeters(1.0);