]> git.taranathan.com Git - FRC2026.git/commitdiff
Merge branch 'arnavs-mega-velocityvoltage-turret' into beta-bot
authormaxwtan <100314265+MaxwellTTan20@users.noreply.github.com>
Mon, 16 Feb 2026 20:12:25 +0000 (12:12 -0800)
committermaxwtan <100314265+MaxwellTTan20@users.noreply.github.com>
Mon, 16 Feb 2026 20:12:25 +0000 (12:12 -0800)
1  2 
src/main/java/frc/robot/subsystems/turret/Turret.java

index f856892ebeaf8fe8f7fc97b990f298e848e47df0,d513f768f680a04e814aa24c8fb823a2f008455e..e7d3bfe5f81cd9266d33241e1bc8f68ab3d56569
@@@ -50,22 -32,24 +50,26 @@@ public class Turret extends SubsystemBa
  
        /* ---------------- Constants ---------------- */
  
 -      private static final double MIN_ANGLE_RAD = Units.degreesToRadians(TurretConstants.MIN_ANGLE);
 -      private static final double MAX_ANGLE_RAD = Units.degreesToRadians(TurretConstants.MAX_ANGLE);
 +      private static final double MIN_ANGLE_RAD = Units.degreesToRadians(-180); // Change this later to the actual values
 +      private static final double MAX_ANGLE_RAD = Units.degreesToRadians(180);
  
 -      private static final double MAX_VEL_RAD_PER_SEC = 600;
 +      private static final double MAX_VEL_RAD_PER_SEC = 15;
 +      //private static final double MAX_VEL_RAD_PER_SEC = 3.0; // Starting super duper slow for now
 +      // private static final double MAX_ACCEL_RAD_PER_SEC2 = 160.0;
        private static final double MAX_ACCEL_RAD_PER_SEC2 = 160.0;
  
 -      private static final double VERSA_RATIO = 5.0;
 -      private static final double TURRET_RATIO = 140.0 / 10.0;
 -      private static final double GEAR_RATIO = VERSA_RATIO * TURRET_RATIO;
 +      private static final double GEAR_RATIO = TurretConstants.TURRET_GEAR_RATIO;
  
-       private static final PIDController positionPID = new PIDController(15.0, 0, 0.0);
-       // private static final PIDController positionPID = new PIDController(15, 0, 0.25);
-       private static final PIDController velocityPID = new PIDController(0.2, 0.0, 0.0);
+       private static final PIDController positionPID = new PIDController(15, 0, 0.25);
+       //private static final PIDController longVelocityPID = new PIDController(15, 0, 1.0);
+       private static final PIDController velocityPID = new PIDController(0.0, 0.0, 0.0);
+       private final LinearFilter setpointFilter = LinearFilter.singlePoleIIR(0.02
+       , 0.02);
+       //hello
  
 +    private final CANcoder encoderLeft = new CANcoder(0, Constants.SUBSYSTEM_CANIVORE_CAN);
 +    private final CANcoder encoderRight = new CANcoder(1, Constants.SUBSYSTEM_CANIVORE_CAN);
  
      private final TurretIOInputsAutoLogged inputs = new TurretIOInputsAutoLogged();