fix arm on com bot, will not work on practice

inverted sensor phase
This commit is contained in:
lukesta182
2019-03-21 15:11:32 -06:00
parent 52551db134
commit 6fa5c986a6
2 changed files with 6 additions and 5 deletions
@@ -146,10 +146,11 @@ public class Arm extends Subsystem implements ControlLoopable
motor1.configPeakOutputReverse(-1, TalonSRXEncoder.TIMEOUT_MS);
motor1.selectProfileSlot(MM_SLOT, 0);
//motor1.config_kF(MM_SLOT, F_Value, TalonSRXEncoder.TIMEOUT_MS);
motor1.config_kF(MM_SLOT, F_Value, TalonSRXEncoder.TIMEOUT_MS);
motor1.config_kP(MM_SLOT, P_Value, TalonSRXEncoder.TIMEOUT_MS);
motor1.config_kI(MM_SLOT, I_Value, TalonSRXEncoder.TIMEOUT_MS);
motor1.config_kD(MM_SLOT, D_Value, TalonSRXEncoder.TIMEOUT_MS);
motor1.setSensorPhase(true);
motor1.configForwardLimitSwitchSource(limitSwitchSource, LimitSwitchNormal.NormallyOpen, 0);
motor1.configReverseLimitSwitchSource(limitSwitchSource, LimitSwitchNormal.NormallyOpen, 0);
@@ -331,7 +332,7 @@ public class Arm extends Subsystem implements ControlLoopable
// Do the update
if (armControlMode == ArmControlMode.JOYSTICK_MANUAL) {
controlManualWithJoystick();
//System.err.println(motor1.getControlMode());
System.err.println(motor1.getControlMode());
}
else if (!isFinished) {
if (armControlMode == ArmControlMode.MOTION_PROFILE) {
@@ -340,11 +341,11 @@ public class Arm extends Subsystem implements ControlLoopable
}
if (armControlMode == ArmControlMode.JOYSTICK_PID){
controlPidWithJoystick();
//System.err.println(motor1.getControlMode());
System.err.println(motor1.getControlMode());
}
if (armControlMode == ArmControlMode.MOTION_MAGIC){
controlMMWithJoystick();
//System.err.println(motor1.getControlMode());
System.err.println(motor1.getControlMode());
}
/*else if (armControlMode == ArmControlMode.MP_PATH_VELOCITY) {
@@ -266,7 +266,7 @@ public class Drive extends Subsystem implements ControlLoopable
//rightDrive1.setVoltageRampRate(VOLTAGE_RAMP_RATE);
//rightDrive1.setNominalClosedLoopVoltage(12.0);
rightDrive1.clearFaults();
rightDrive1.setInverted(false);//false on comp, false on practice
rightDrive1.setInverted(true);//false on comp, false on practice
//rightDrive1.setSensorPhase(true);//true on comp 2108, true on microbot
//rightDrive1.setSafetyEnabled(false);
rightDrive1.setIdleMode(IdleMode.kBrake);