Stop pid subsystems in the command instead of subsystem
This commit is contained in:
parent
247e00ab75
commit
73c96c9b9d
@ -21,7 +21,8 @@ public class ResetLower extends CommandBase {
|
||||
}
|
||||
// Make this return true when this Command no longer needs to run execute()
|
||||
protected boolean isFinished() {
|
||||
return mainArm.getBottomPressed();
|
||||
// Stop when either limit switch is hit
|
||||
return mainArm.getBottomPressed() || mainArm.getTopPressed();
|
||||
}
|
||||
// Called once after isFinished returns true
|
||||
protected void end() {
|
||||
|
@ -21,7 +21,8 @@ public class ResetUpper extends CommandBase {
|
||||
}
|
||||
// Make this return true when this Command no longer needs to run execute()
|
||||
protected boolean isFinished() {
|
||||
return mainArm.getTopPressed();
|
||||
// Stop when either limit switch is hit
|
||||
return mainArm.getBottomPressed() || mainArm.getTopPressed();
|
||||
}
|
||||
// Called once after isFinished returns true
|
||||
protected void end() {
|
||||
|
@ -27,7 +27,8 @@ public class SetArmPosition extends CommandBase {
|
||||
}
|
||||
// Make this return true when this Command no longer needs to run execute()
|
||||
protected boolean isFinished() {
|
||||
return false;
|
||||
// Stop when either limit switch is hit
|
||||
return mainArm.getBottomPressed() || mainArm.getTopPressed();
|
||||
}
|
||||
// Called once after isFinished returns true
|
||||
protected void end() {
|
||||
|
@ -31,12 +31,7 @@ public class MainArm extends PIDSubsystem {
|
||||
return getDegrees();
|
||||
}
|
||||
protected void usePIDOutput(double output) {
|
||||
// Only run if neither limit switch is hit
|
||||
if (!calibrate()) {
|
||||
moveArm(output);
|
||||
} else {
|
||||
moveArm(0);
|
||||
}
|
||||
}
|
||||
public double getRaw() {
|
||||
return pot.getAverageVoltage();
|
||||
|
Loading…
x
Reference in New Issue
Block a user