Added DriveWithJoystickAuxPID

Has been tested, does work but it stalled a falcon.
This commit is contained in:
keenandbuckley
2020-02-08 12:37:48 -07:00
parent 71bd46cc85
commit ea632f626f
4 changed files with 92 additions and 60 deletions
@@ -330,6 +330,15 @@ public class Drive extends SubsystemBase {
m_driveTrain.arcadeDrive(move, steer);
}
public void driveWithInputAux(double move, double targetGyro) {
m_rightFrontMotor.selectProfileSlot(DriveConstants.SLOT_TURNING, DriveConstants.PID_TURN);
m_rightFrontMotor.set(TalonFXControlMode.PercentOutput, move, DemandType.AuxPID, targetGyro);
m_leftFrontMotor.follow(m_rightFrontMotor, FollowerType.AuxOutput1);
m_driveTrain.feedWatchdog();
}
/**
* Runs a position PID while driving straight
* @param targetPos The position to drive to in units