Skip to content

Commit d05973b

Browse files
authored
Merge pull request #131 from LED-esma/physics_update
Update Physics4Wheel
2 parents 242924b + d9d546a commit d05973b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

Physics4Wheel/src/robot.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,20 @@ def robotInit(self):
1818
self.lstick = wpilib.Joystick(0)
1919
self.rstick = wpilib.Joystick(1)
2020

21+
# Define front and rear motors
2122
self.lf_motor = wpilib.Jaguar(1)
2223
self.lr_motor = wpilib.Jaguar(2)
2324
self.rf_motor = wpilib.Jaguar(3)
2425
self.rr_motor = wpilib.Jaguar(4)
2526

26-
l_motor = wpilib.MotorControllerGroup(self.lf_motor, self.lr_motor)
27-
r_motor = wpilib.MotorControllerGroup(self.rf_motor, self.rr_motor)
27+
# add the followers to the left and right motors
28+
self.lf_motor.addFollower(self.lr_motor)
29+
self.rf_motor.addFollower(self.rr_motor)
2830

29-
self.drive = wpilib.drive.DifferentialDrive(l_motor, r_motor)
31+
# Set the right side motors to be inverted
32+
self.lf_motor.setInverted(True)
33+
34+
self.drive = wpilib.drive.DifferentialDrive(self.lf_motor, self.lr_motor)
3035

3136
# Position gets automatically updated as robot moves
3237
self.gyro = wpilib.AnalogGyro(1)

0 commit comments

Comments
 (0)