diff --git a/src/main/java/frc4388/robot/commands/RunClaw.java b/src/main/java/frc4388/robot/commands/RunClaw.java index 8f2cfa0..2cf76af 100644 --- a/src/main/java/frc4388/robot/commands/RunClaw.java +++ b/src/main/java/frc4388/robot/commands/RunClaw.java @@ -15,9 +15,6 @@ public class RunClaw extends CommandBase { public Claws.ClawType clawType; public boolean open; - // current limit - public double currentLimit; - /** * Creates a new RunClaw, which runs a claw. * @param sClaws Claws subsystem. @@ -29,8 +26,6 @@ public class RunClaw extends CommandBase { m_claws = sClaws; clawType = which; this.open = open; - - currentLimit = ClawConstants.CURRENT_LIMIT; addRequirements(m_claws); } @@ -52,6 +47,6 @@ public class RunClaw extends CommandBase { // Returns true when the command should end. @Override public boolean isFinished() { - return m_claws.checkSwitchAndCurrent(clawType, currentLimit); + return m_claws.checkSwitchAndCurrent(clawType); } } diff --git a/src/main/java/frc4388/robot/subsystems/Claws.java b/src/main/java/frc4388/robot/subsystems/Claws.java index 0f79620..7476238 100644 --- a/src/main/java/frc4388/robot/subsystems/Claws.java +++ b/src/main/java/frc4388/robot/subsystems/Claws.java @@ -105,7 +105,7 @@ public class Claws extends SubsystemBase { * @param limit The current limit. * @return Whether to interrupt the RunClaw command or not. */ - public boolean checkSwitchAndCurrent(ClawType which, double limit) { + public boolean checkSwitchAndCurrent(ClawType which) { // if still calibrating, stop RunClaw /*if (((Double) m_leftOffset == null) || ((Double) m_rightOffset == null)) { @@ -113,11 +113,11 @@ public class Claws extends SubsystemBase { }*/ if (which == ClawType.LEFT) { - if (m_leftLimitSwitchF.isPressed() || m_leftLimitSwitchR.isPressed() || m_leftClaw.getOutputCurrent() >= limit) { + if (m_leftLimitSwitchF.isPressed() || m_leftLimitSwitchR.isPressed() || m_leftClaw.getOutputCurrent() >= ClawConstants.CURRENT_LIMIT) { return true; } } else if (which == ClawType.RIGHT) { - if (m_rightLimitSwitchF.isPressed() || m_rightLimitSwitchR.isPressed() || m_rightClaw.getOutputCurrent() >= limit) { + if (m_rightLimitSwitchF.isPressed() || m_rightLimitSwitchR.isPressed() || m_rightClaw.getOutputCurrent() >= ClawConstants.CURRENT_LIMIT) { return true; } }