Skip to content

Commit fc932ca

Browse files
committed
Maybe fixed integral issue?
1 parent daa4db8 commit fc932ca

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/main/java/frc/robot/subsystems/endEffector/EndEffector.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,13 @@ public EndEffector(EndEffectorIO io) {
5050
new ProfiledPIDController(1, 0, 0.2, new TrapezoidProfile.Constraints(1, 1));
5151
}
5252
}
53-
setArticulation(CoralPickupRotation);
53+
54+
adjustedPos =
55+
angleModulus((inputs.articulationPosition.minus(AbsoluteEncoderOffset)).getRadians());
56+
57+
adjustedPos = 90 - adjustedPos * (180 / Math.PI);
58+
59+
setArticulation(Rotation2d.fromDegrees(adjustedPos));
5460

5561
articulationSysId =
5662
new SysIdRoutine(
@@ -125,14 +131,15 @@ public void periodic() {
125131

126132
}
127133

134+
128135
public void setIntakeSpeed(double speed) {
129136
io.spinRunVoltage(12.0 * speed);
130137
}
131138

132139
public void setArticulation(Rotation2d rotation) {
133140
articulationSetpoint = rotation;
134-
135141
articulationPID.setGoal(articulationSetpoint.getDegrees());
142+
//articulationPID.reset(articulationSetpoint.getDegrees(), 0.0);
136143
}
137144

138145
@AutoLogOutput

0 commit comments

Comments
 (0)