Skip to content

Commit 2e466bc

Browse files
RHR2713Sid220
andcommitted
PIDonSparks Pivot
Co-Authored-By: Sidney Trzepacz <74916637+Sid220@users.noreply.github.com>
1 parent 1c15c03 commit 2e466bc

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/main/java/frc/robot/subsystems/shooterPivot/ShooterPivotIOSparks.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package frc.robot.subsystems.shooterPivot;
22

3+
import com.revrobotics.CANSparkBase.ControlType;
34
import com.revrobotics.CANSparkBase.IdleMode;
45
import com.revrobotics.CANSparkLowLevel.MotorType;
56
import com.revrobotics.CANSparkLowLevel.PeriodicFrame;
@@ -70,12 +71,6 @@ public void updateInputs(ShooterPivotInputs inputs) {
7071
inputs.currentDrawOne = spark.getOutputCurrent();
7172

7273
inputs.outputVoltage = spark.getBusVoltage();
73-
74-
double effort =
75-
motorController.calculate(inputs.absoluteEncoderAdjustedAngle, this.targetAngle);
76-
77-
effort = MathUtil.clamp(effort, -12, 12);
78-
setVoltage(effort);
7974
}
8075

8176
@Override
@@ -92,5 +87,6 @@ public void setVoltage(double volts) {
9287
@Override
9388
public void setTargetPosition(double angleDeg) {
9489
this.targetAngle = angleDeg;
90+
this.spark.getPIDController().setReference(angleDeg, ControlType.kPosition);
9591
}
9692
}

0 commit comments

Comments
 (0)