File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed
src/main/java/frc/robot/subsystems/shooterPivot Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change 1
1
package frc .robot .subsystems .shooterPivot ;
2
2
3
+ import com .revrobotics .CANSparkBase .ControlType ;
3
4
import com .revrobotics .CANSparkBase .IdleMode ;
4
5
import com .revrobotics .CANSparkLowLevel .MotorType ;
5
6
import com .revrobotics .CANSparkLowLevel .PeriodicFrame ;
@@ -70,12 +71,6 @@ public void updateInputs(ShooterPivotInputs inputs) {
70
71
inputs .currentDrawOne = spark .getOutputCurrent ();
71
72
72
73
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 );
79
74
}
80
75
81
76
@ Override
@@ -92,5 +87,6 @@ public void setVoltage(double volts) {
92
87
@ Override
93
88
public void setTargetPosition (double angleDeg ) {
94
89
this .targetAngle = angleDeg ;
90
+ this .spark .getPIDController ().setReference (angleDeg , ControlType .kPosition );
95
91
}
96
92
}
You can’t perform that action at this time.
0 commit comments