File tree Expand file tree Collapse file tree 2 files changed +15
-5
lines changed
HatchbotInlined/subsystems
HatchbotTraditional/subsystems Expand file tree Collapse file tree 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -20,10 +20,18 @@ def __init__(self) -> None:
2020 self .right1 = wpilib .PWMVictorSPX (constants .kRightMotor1Port )
2121 self .right2 = wpilib .PWMVictorSPX (constants .kRightMotor2Port )
2222
23+ self .left1 .addFollower (self .left2 )
24+ self .right1 .addFollower (self .right2 )
25+
26+ # We need to invert one side of the drivetrain so that positive speeds
27+ # result in both sides moving forward. Depending on how your robot's
28+ # drivetrain is constructed, you might have to invert the left side instead.
29+ self .right1 .setInverted (True )
30+
2331 # The robot's drive
2432 self .drive = wpilib .drive .DifferentialDrive (
25- wpilib . MotorControllerGroup ( self .left1 , self . left2 ) ,
26- wpilib . MotorControllerGroup ( self .right1 , self . right2 ),
33+ self .left1 ,
34+ self .right1
2735 )
2836
2937 # The left-side drive encoder
Original file line number Diff line number Diff line change @@ -20,13 +20,15 @@ def __init__(self) -> None:
2020 self .right1 = wpilib .PWMVictorSPX (constants .kRightMotor1Port )
2121 self .right2 = wpilib .PWMVictorSPX (constants .kRightMotor2Port )
2222
23- self .left1 .addFollower (self .left2 )
24- self .right1 .addFollower (self .right2 )
23+ # We need to invert one side of the drivetrain so that positive speeds
24+ # result in both sides moving forward. Depending on how your robot's
25+ # drivetrain is constructed, you might have to invert the left side instead.
26+ self .right1 .setInverted (True )
2527
2628 # The robot's drive
2729 self .drive = wpilib .drive .DifferentialDrive (
2830 self .left1 ,
29- self .right1 ,
31+ self .right1
3032 )
3133
3234 # The left-side drive encoder
You can’t perform that action at this time.
0 commit comments