mirror of
https://github.com/Team4388/2019-Hit-or-Miss.git
synced 2026-06-09 00:28:05 -06:00
Fix armControlMode vs controlMode conflict
controlLoopUpdate() was reading rogue variable "controlMode", which never changed, instead of "armControlMode" used by the rest of the code
This commit is contained in:
@@ -91,7 +91,6 @@ public class Arm extends Subsystem implements ControlLoopable
|
|||||||
// Pneumatics
|
// Pneumatics
|
||||||
private Solenoid speedShift;
|
private Solenoid speedShift;
|
||||||
|
|
||||||
private ArmControlMode controlMode = ArmControlMode.JOYSTICK_MANUAL;
|
|
||||||
// Misc
|
// Misc
|
||||||
public static final double AUTO_ZERO_MOTOR_CURRENT = 4.0;
|
public static final double AUTO_ZERO_MOTOR_CURRENT = 4.0;
|
||||||
private boolean isFinished;
|
private boolean isFinished;
|
||||||
@@ -253,23 +252,23 @@ public class Arm extends Subsystem implements ControlLoopable
|
|||||||
lastControlLoopUpdateTimestamp = currentTimestamp;
|
lastControlLoopUpdateTimestamp = currentTimestamp;
|
||||||
|
|
||||||
// Do the update
|
// Do the update
|
||||||
if (controlMode == ArmControlMode.JOYSTICK_MANUAL) {
|
if (armControlMode == ArmControlMode.JOYSTICK_MANUAL) {
|
||||||
controlManualWithJoystick();
|
controlManualWithJoystick();
|
||||||
}
|
}
|
||||||
else if (!isFinished) {
|
else if (!isFinished) {
|
||||||
if (controlMode == ArmControlMode.MOTION_PROFILE) {
|
if (armControlMode == ArmControlMode.MOTION_PROFILE) {
|
||||||
isFinished = mpController.controlLoopUpdate(getPositionInches());
|
isFinished = mpController.controlLoopUpdate(getPositionInches());
|
||||||
}
|
}
|
||||||
if (controlMode == ArmControlMode.JOYSTICK_PID){
|
if (armControlMode == ArmControlMode.JOYSTICK_PID){
|
||||||
controlPidWithJoystick();
|
controlPidWithJoystick();
|
||||||
System.err.println("test of pid");
|
System.err.println("test of pid");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*else if (controlMode == ArmControlMode.MP_PATH_VELOCITY) {
|
/*else if (armControlMode == ArmControlMode.MP_PATH_VELOCITY) {
|
||||||
isFinished = mpPathVelocityController.controlLoopUpdate(getGyroAngleDeg());
|
isFinished = mpPathVelocityController.controlLoopUpdate(getGyroAngleDeg());
|
||||||
}
|
}
|
||||||
else if (controlMode == ArmControlMode.ADAPTIVE_PURSUIT) {
|
else if (armControlMode == ArmControlMode.ADAPTIVE_PURSUIT) {
|
||||||
updatePose();
|
updatePose();
|
||||||
isFinished = adaptivePursuitController.controlLoopUpdate(currentPose);
|
isFinished = adaptivePursuitController.controlLoopUpdate(currentPose);
|
||||||
}*/
|
}*/
|
||||||
@@ -367,4 +366,4 @@ public class Arm extends Subsystem implements ControlLoopable
|
|||||||
}
|
}
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user