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):
18
18
self .lstick = wpilib .Joystick (0 )
19
19
self .rstick = wpilib .Joystick (1 )
20
20
21
+ # Define front and rear motors
21
22
self .lf_motor = wpilib .Jaguar (1 )
22
23
self .lr_motor = wpilib .Jaguar (2 )
23
24
self .rf_motor = wpilib .Jaguar (3 )
24
25
self .rr_motor = wpilib .Jaguar (4 )
25
26
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 )
28
30
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 )
30
35
31
36
# Position gets automatically updated as robot moves
32
37
self .gyro = wpilib .AnalogGyro (1 )
You can’t perform that action at this time.
0 commit comments