Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instantiate rollers last #33

Merged
merged 1 commit into from
Feb 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading