]> git.taranathan.com Git - FRC2026.git/commitdiff
fdsa
authorWesleyWong-972 <wesleycwong@gmail.com>
Wed, 21 Jan 2026 01:21:57 +0000 (17:21 -0800)
committerWesleyWong-972 <wesleycwong@gmail.com>
Wed, 21 Jan 2026 01:21:57 +0000 (17:21 -0800)
src/main/java/frc/robot/RobotContainer.java
src/main/java/frc/robot/subsystems/turret/Turret.java
src/main/java/frc/robot/subsystems/turret/TurretConstants.java

index 4ad3c92553887f0e265fc93eee72111e90c16215..36211e8a18bc107a455d31f6fec57788fcc42773 100644 (file)
@@ -118,8 +118,6 @@ public class RobotContainer {
     LiveWindow.setEnabled(false);
 
     SmartDashboard.putData("Shutdown Orange Pis", new ShutdownAllPis());
-
-    
   }
 
   /**
index a30def92807f4bf117cd9bad0e86a7c4d5832109..c1c043c750eaeea5b623fef99d17ec230d149e8c 100644 (file)
@@ -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() {
index 569cc389a3eabbfa07ab64a69f163198778f254f..c1637809eac717b373067edb3ef3a32b625a7d5d 100644 (file)
@@ -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);