1616import com .revrobotics .spark .config .SparkMaxConfig ;
1717import edu .wpi .first .wpilibj2 .command .Command ;
1818import edu .wpi .first .wpilibj2 .command .SubsystemBase ;
19- import frc .robot .Constants ;
19+ import frc .robot .Constants . IntakeConstants ;
2020
2121public class Intake extends SubsystemBase {
2222 SparkMax intakeMotor =
23- new SparkMax (Constants . IntakeConstants .SPINTAKEID , MotorType .kBrushless ); // 10, for now
23+ new SparkMax (IntakeConstants .SPINTAKEID , MotorType .kBrushless ); // 10, for now
2424 RelativeEncoder encoder ;
2525 SparkMaxConfig config = new SparkMaxConfig ();
2626 SparkClosedLoopController controller = intakeMotor .getClosedLoopController ();
@@ -40,14 +40,14 @@ public Intake() {
4040 .feedbackSensor (FeedbackSensor .kPrimaryEncoder )
4141 // Set PID values for position control. We don't need to pass a closed loop
4242 // slot, as it will default to slot 0.
43- .p (0.1 )
44- .i (0 )
45- .d (0 )
43+ .p (IntakeConstants . kP1 )
44+ .i (IntakeConstants . kI1 )
45+ .d (IntakeConstants . kD1 )
4646 .outputRange (-1 , 1 )
4747 // Set PID values for velocity control in slot 1
48- .p (0.0001 , ClosedLoopSlot .kSlot1 )
49- .i (0 , ClosedLoopSlot .kSlot1 )
50- .d (0 , ClosedLoopSlot .kSlot1 )
48+ .p (IntakeConstants . kP2 , ClosedLoopSlot .kSlot1 )
49+ .i (IntakeConstants . kI2 , ClosedLoopSlot .kSlot1 )
50+ .d (IntakeConstants . kD2 , ClosedLoopSlot .kSlot1 )
5151 .outputRange (-1 , 1 , ClosedLoopSlot .kSlot1 )
5252 .feedForward
5353 // kV is now in Volts, so we multiply by the nominal voltage (12V)
@@ -78,14 +78,14 @@ public Command intakeCMD() {
7878 // Takes in
7979 return runOnce (
8080 () -> {
81- intakeMotor .set (Constants . IntakeConstants .INTAKE_SPEED );
81+ intakeMotor .set (IntakeConstants .INTAKE_SPEED );
8282 });
8383 }
8484 // Spits out
8585 public Command spitakeCMD () {
8686 return runOnce (
8787 () -> {
88- intakeMotor .set (Constants . IntakeConstants .SPITAKE_SPEED );
88+ intakeMotor .set (IntakeConstants .SPITAKE_SPEED );
8989 });
9090 }
9191
0 commit comments