Skip to content

Commit

Permalink
Instantiate rollers last
Browse files Browse the repository at this point in the history
  • Loading branch information
suryatho committed Feb 19, 2024
1 parent 0696b49 commit bd3d8b2
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main/java/org/littletonrobotics/frc2024/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public RobotContainer() {
Indexer indexer = null;
Intake intake = null;
Arm arm = null;
RollersSensorsIO rollersSensorsIO = null;

// Create subsystems
if (Constants.getMode() != Constants.Mode.REPLAY) {
Expand Down Expand Up @@ -117,7 +118,7 @@ public RobotContainer() {
feeder = new Feeder(new FeederIOKrakenFOC());
indexer = new Indexer(new IndexerIOSparkFlex());
intake = new Intake(new IntakeIOKrakenFOC());
rollers = new Rollers(feeder, indexer, intake, new RollersSensorsIOReal());
rollersSensorsIO = new RollersSensorsIOReal();

arm = new Arm(new ArmIOKrakenFOC());
}
Expand All @@ -134,7 +135,7 @@ public RobotContainer() {
feeder = new Feeder(new FeederIOSim());
indexer = new Indexer(new IndexerIOSim());
intake = new Intake(new IntakeIOSim());
rollers = new Rollers(feeder, indexer, intake, new RollersSensorsIO() {});
rollersSensorsIO = new RollersSensorsIO() {};

arm = new Arm(new ArmIOSim());
}
Expand Down Expand Up @@ -171,12 +172,13 @@ public RobotContainer() {
if (intake == null) {
intake = new Intake(new IntakeIO() {});
}
if (rollers == null) {
rollers = new Rollers(feeder, indexer, intake, new RollersSensorsIO() {});
if (rollersSensorsIO == null) {
rollersSensorsIO = new RollersSensorsIO() {};
}
if (arm == null) {
arm = new Arm(new ArmIO() {});
}
rollers = new Rollers(feeder, indexer, intake, rollersSensorsIO);
superstructure = new Superstructure(arm);

// Configure autos and buttons
Expand Down

0 comments on commit bd3d8b2

Please sign in to comment.