Lesson 13.8: Build RobotHardware.java
RobotHardware gives every OpMode one entry point to the robot. It owns the subsystem objects, initializes them, updates ongoing work, and stops powered hardware.
The Composition Root
package org.firstinspires.ftc.teamcode;
import com.qualcomm.robotcore.hardware.HardwareMap;
public class RobotHardware {
public final Intake intake = new Intake();
public final Lift lift = new Lift();
public void init(HardwareMap hardwareMap) {
intake.init(hardwareMap);
lift.init(hardwareMap);
}
public void update() {
lift.update();
}
public void stopAll() {
intake.stop();
lift.stop();
}
}
This class does not replace the subsystems. It connects them. The intake still owns intake behavior, and the lift still owns lift behavior.
Keep update() short and non-blocking. An OpMode will call it every cycle, including while an autonomous path is running.
Project Practice
Initialize both subsystems, delegate periodic updates, and provide one cleanup path.
Unit 13.8 Robot Hardware Project
Each tab is a separate Java file in the same TeamCode package. Every stage compiles as one project, and the finished TeleOp can run.
Your project saves in this browser. Export it after Lesson 13.9 so you can use the same classes in the final autonomous lesson.
Ready to move on?
Only mark complete if you genuinely understand the material. Your progress will be saved in this browser.
Stuck on this lesson?
Ask about anything on this page. It can see which lesson you have open and which part you are reading.