[wpilibjexamples] Remove unnecessary voltage desaturation

This commit is contained in:
Prateek Machiraju
2022-06-02 20:10:50 -07:00
committed by Peter Johnson
parent 2fa52007af
commit a4ec13eb0e

View File

@@ -194,11 +194,6 @@ public class DriveSubsystem extends SubsystemBase {
* @param rightVolts the commanded right output
*/
public void tankDriveVolts(double leftVolts, double rightVolts) {
var batteryVoltage = RobotController.getBatteryVoltage();
if (Math.max(Math.abs(leftVolts), Math.abs(rightVolts)) > batteryVoltage) {
leftVolts *= batteryVoltage / 12.0;
rightVolts *= batteryVoltage / 12.0;
}
m_leftMotors.setVoltage(leftVolts);
m_rightMotors.setVoltage(rightVolts);
m_drive.feed();