Skip to content

Commit

Permalink
creating drive train
Browse files Browse the repository at this point in the history
  • Loading branch information
GriffinEC2 committed Sep 22, 2024
1 parent 6398cbe commit d7354a4
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj2.command.Command;
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
import frc.robot.subsystems.drive.Drive;
import frc.robot.subsystems.drive.DriveIO;
import frc.robot.subsystems.drive.DriveIOReal;
import frc.robot.subsystems.drive.GyroIO;
import frc.robot.subsystems.drive.GyroIOPigeon2;
import frc.robot.util.Alert;
import frc.robot.util.Alert.AlertType;
import frc.robot.util.loggedShuffleboardClasses.LoggedShuffleboardChooser;
Expand All @@ -29,6 +34,7 @@
*/
public class RobotContainer {
// Subsystems
private final Drive drive;

// Pose Manager

Expand All @@ -44,6 +50,36 @@ public class RobotContainer {

/** The container for the robot. Contains subsystems, OI devices, and commands. */
public RobotContainer() {
switch (Constants.currentMode) {
case REAL:
// Real robot, instantiate hardware IO implementations
drive =
new Drive(
new DriveIOReal(), new GyroIOPigeon2());
break;

case SIM:
// Sim robot, instantiate physics sim IO implementations
drive =
new Drive(
new DriveIO() {

}, // Replace with sim once available
new GyroIO() {}
);
break;

default:
// Replayed robot, disable IO implementations
drive =
new Drive(
new DriveIO() {

},
new GyroIO() {}
);
break;
}

// Set up auto routines

Expand Down

0 comments on commit d7354a4

Please sign in to comment.