mirror of
https://github.com/Team4388/2022NoWayHome.git
synced 2026-06-09 00:38:05 -06:00
current limit is constant
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user