File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff 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 )
You can’t perform that action at this time.
0 commit comments