From ae5fc4cb00dee49b3aadedaaf8d4581958fbc52d Mon Sep 17 00:00:00 2001 From: "Keenan D. Buckley" Date: Thu, 30 Jan 2020 21:36:11 -0700 Subject: [PATCH] Invert Right side so PID Loops work - Invert Right Motor - Invert Right side on differential drive to allow for driving normally without subsequent motor inverts --- src/main/java/frc4388/robot/subsystems/Drive.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/java/frc4388/robot/subsystems/Drive.java b/src/main/java/frc4388/robot/subsystems/Drive.java index 272bc54..8c9e346 100644 --- a/src/main/java/frc4388/robot/subsystems/Drive.java +++ b/src/main/java/frc4388/robot/subsystems/Drive.java @@ -130,7 +130,8 @@ public class Drive extends SubsystemBase { /* flip input so forward becomes back, etc */ m_leftFrontMotor.setInverted(false); - m_rightFrontMotor.setInverted(false); + m_rightFrontMotor.setInverted(true); + m_driveTrain.setRightSideInverted(true); m_leftBackMotor.setInverted(InvertType.FollowMaster); m_rightBackMotor.setInverted(InvertType.FollowMaster); @@ -306,7 +307,7 @@ public class Drive extends SubsystemBase { * Add your docs here. */ public void driveWithInput(double move, double steer){ - m_rightFrontMotor.setInverted(false); + //m_rightFrontMotor.setInverted(false); m_driveTrain.arcadeDrive(move, steer); } @@ -318,7 +319,7 @@ public class Drive extends SubsystemBase { public void runVelocityPID(double targetVel, double targetGyro) { m_rightFrontMotor.selectProfileSlot(DriveConstants.SLOT_VELOCITY, DriveConstants.PID_PRIMARY); m_rightFrontMotor.selectProfileSlot(DriveConstants.SLOT_TURNING, DriveConstants.PID_TURN); - m_rightFrontMotor.setInverted(false); + //m_rightFrontMotor.setInverted(false); m_rightFrontMotor.set(TalonFXControlMode.PercentOutput, targetVel, DemandType.AuxPID, targetGyro); m_leftFrontMotor.follow(m_rightFrontMotor, FollowerType.AuxOutput1); }