Skip to content

Commit

Permalink
Always un power arm at min angle and stow
Browse files Browse the repository at this point in the history
  • Loading branch information
suryatho committed Apr 13, 2024
1 parent 1befc76 commit b3f7c8b
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,8 @@ public void setOverrides(BooleanSupplier disableOverride, BooleanSupplier coastO
coastSupplier = coastOverride;
}

private boolean shouldPartialStow() {
return (DriverStation.isTeleopEnabled() && RobotState.getInstance().inCloseShootingZone());
}

private double getStowAngle() {
if (shouldPartialStow()) {
if (DriverStation.isTeleopEnabled() && RobotState.getInstance().inCloseShootingZone()) {
return MathUtil.clamp(
setpointState.position,
minAngle.getRadians(),
Expand Down Expand Up @@ -223,7 +219,7 @@ public void periodic() {
Units.degreesToRadians(lowerLimitDegrees.get()),
Units.degreesToRadians(upperLimitDegrees.get())),
0.0));
if (goal == Goal.STOW && !shouldPartialStow() && atGoal()) {
if (goal == Goal.STOW && goalAngle == minAngle.getRadians() && atGoal()) {
io.stop();
} else {
io.runSetpoint(
Expand Down

0 comments on commit b3f7c8b

Please sign in to comment.