Finished High Gear Velocity and Turning, Working on High Gear Motion Magic

This commit is contained in:
Aarav Shah
2020-03-01 12:33:09 -07:00
parent d8f15ccdb0
commit 26a208524e
4 changed files with 28 additions and 10 deletions
@@ -126,7 +126,15 @@ public class Drive extends SubsystemBase {
m_rightFrontMotor.configNeutralDeadband(DriveConstants.NEUTRAL_DEADBAND, DriveConstants.DRIVE_TIMEOUT_MS);
/* PID for Front Motor Control in Teleop */
setRightMotorGains(false);
try {
if (m_pneumaticsSubsystem.m_isSpeedShiftHigh) {
setRightMotorGains(true);
} else {
setRightMotorGains(false);
}
} catch (Exception e) {
System.err.println("Error while trying to switch gains.");
}
/* PID for Back Motor Control in Tank Drive Vel */
m_rightBackMotor.selectProfileSlot(DriveConstants.SLOT_VELOCITY, DriveConstants.PID_PRIMARY);