current limit is constant

This commit is contained in:
aarav18
2022-03-05 23:16:29 -07:00
parent 20353cdbe0
commit 772bd4d8dd
2 changed files with 4 additions and 9 deletions
@@ -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);
}
}
@@ -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;
}
}