Skip to content

Commit

Permalink
Using deprecated MotorController for working follow
Browse files Browse the repository at this point in the history
Remove Drive Forever from binding
  • Loading branch information
anivanchen committed Jan 17, 2024
1 parent 980c5f9 commit fa7b6d0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/main/java/com/stuypulse/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ private void configureDriverBindings() {
}

private void configureOperatorBindings() {
driver.getLeftButton().onTrue(new DrivetrainDriveForever(2));
}

/**************/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.stuypulse.stuylib.math.Angle;

import edu.wpi.first.wpilibj.drive.DifferentialDrive;
import edu.wpi.first.wpilibj.motorcontrol.MotorControllerGroup;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;

public class Drivetrain extends AbstractDrivetrain {
Expand All @@ -19,8 +20,9 @@ public class Drivetrain extends AbstractDrivetrain {
private final CANSparkMax rightBack;

public Drivetrain() {
leftFront = new CANSparkMax(Ports.Drivetrain.LEFTFRONT, MotorType.kBrushless);
leftBack = new CANSparkMax(Ports.Drivetrain.LEFTREAR, MotorType.kBrushless);
leftFront = new CANSparkMax(Ports.Drivetrain.LEFTFRONT, MotorType.kBrushless);

rightFront = new CANSparkMax(Ports.Drivetrain.RIGHTFRONT, MotorType.kBrushless);
rightBack = new CANSparkMax(Ports.Drivetrain.RIGHTREAR, MotorType.kBrushless);

Expand All @@ -30,10 +32,10 @@ public Drivetrain() {
Motors.Drivetrain.RIGHT.configure(rightFront);
Motors.Drivetrain.RIGHT.configure(rightBack);

leftBack.follow(leftFront);
rightBack.follow(rightFront);
drivetrain = new DifferentialDrive(leftFront, rightFront);
// leftBack.follow(leftFront);
// rightBack.follow(rightFront);

drivetrain = new DifferentialDrive(new MotorControllerGroup(leftFront, leftBack), new MotorControllerGroup(rightFront,rightBack));
}

//********** GETTERS **********//
Expand Down

0 comments on commit fa7b6d0

Please sign in to comment.