Skip to content

Commit

Permalink
Speed up arm emergency lift
Browse files Browse the repository at this point in the history
  • Loading branch information
jwbonner committed Apr 12, 2023
1 parent 3e011e6 commit 4875766
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,12 @@ public void periodic() {
elbowFeedback.reset();

} else if (emergencyLiftDirection != LiftDirection.NONE) {
shoulderAngleSetpoint = emergencyLiftDirection == LiftDirection.FRONT ? 0.0 : Math.PI;
shoulderVoltageFeedback = shoulderFeedback.calculate(shoulderAngle, shoulderAngleSetpoint);
boolean runShoulder =
emergencyLiftDirection == LiftDirection.FRONT
? shoulderAngle > Units.degreesToRadians(10.0)
: shoulderAngle < Units.degreesToRadians(170.0);
shoulderVoltageFeedback =
(runShoulder ? 6.0 : 0.0) * (emergencyLiftDirection == LiftDirection.FRONT ? -1.0 : 1.0);
elbowAngleSetpoint = Math.PI;
elbowVoltageFeedback = elbowFeedback.calculate(elbowAngle, elbowAngleSetpoint);
io.setShoulderVoltage(shoulderVoltageFeedback);
Expand Down

0 comments on commit 4875766

Please sign in to comment.