Skip to content

Commit beea8b9

Browse files
committed
Revert tankdrive usage
1 parent 04dfbbe commit beea8b9

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

DifferentialDriveBot/drivetrain.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@ def __init__(self):
3838
# gearbox is constructed, you might have to invert the left side instead.
3939
self.rightLeader.setInverted(True)
4040

41-
# turns the motors into a group so that we can set voltage to both at once
42-
self.robotDrive = wpilib.drive.DifferentialDrive(self.leftLeader, self.rightLeader)
43-
4441

4542
self.leftEncoder = wpilib.Encoder(0, 1)
4643
self.rightEncoder = wpilib.Encoder(2, 3)
@@ -96,8 +93,9 @@ def setSpeeds(self, speeds: wpimath.kinematics.DifferentialDriveWheelSpeeds):
9693
)
9794

9895
# Controls the left and right sides of the robot using the calculated outputs
99-
self.robotDrive.tankDrive(leftOutput + leftFeedforward, rightOutput + rightFeedforward)
100-
96+
self.leftLeader.setVoltage(leftOutput + leftFeedforward)
97+
self.rightLeader.setVoltage(rightOutput + rightFeedforward)
98+
10199

102100
def drive(self, xSpeed, rot):
103101
"""Drives the robot with the given linear velocity and angular velocity."""

0 commit comments

Comments
 (0)