leftMotor = new TalonFX(0);
pid = new PIDController(0, 0, 0);
+
+
}
public void periodic() {
double motorPosition = getPosition();
double currentPosition = Units.rotationsToRadians(motorPosition/gearRatio);
double power = pid.calculate(currentPosition);
-
+ // THIS IS THE WRONG MOTOR
rollerMotor.set(MathUtil.clamp(power, -1, 1));
}
}
public void setPosition(double position) {
-
-
+ this.position = position;
}
public double getPosition(){
public void extend() {
setPosition(maxExtension);
+
+
}
public void retract(){