Stage 12: Complete Modular TeleOp
The shared project adds PoweredMechanism.java and RobotHardware.java. This stage composes Drivetrain, Intake, Transfer, Launcher, and ArtifactSensors into the runnable DECODE TeleOp. Lift remains in the general lesson examples and is not part of this robot.
Your Task
- Put shared motor state, setup,
setPower(), andstop()behavior inPoweredMechanism. - Reuse it from powered subsystem classes with
extendsand@Overridewhere behavior differs. - Compose every subsystem in
RobotHardware. - Initialize all subsystems through
robot.init(hardwareMap)and update non-blocking state throughrobot.update(). - Stop every subsystem through
robot.stopAll(). - Finish
CompetitionTeleOpusing only the RobotHardware public interface, with no raw motor, servo, or IMU access.
The OpMode should read like coordination code. A passing snapshot becomes the reference that the advanced autonomous stage reuses.
Coding Challenge Simulator
The simulator turns the completed project into a DECODE competition-robot driver-control challenge. Start in Practice to see the predicted artifact trajectory and use a replenishing supply. Switch to Match for a deterministic 120-second run with 18 alliance-side artifacts and no trajectory preview.
The three-artifact robot capacity and two-minute TeleOp clock follow the DECODE Competition Manual.
The visible wheels, all three intake stages, anti-jam transfer spinner, flywheel, and servo trigger follow measured hardware output from your code. Artifacts also follow the physical route through the robot, so a stopped intake, an empty magazine, a trigger pulse that is too short, or a slow flywheel is visible in the simulation. A fixed open-loop launcher power will lose speed and change the shot arc as the virtual battery drains; a reachable setVelocity() target with PIDF stays much more consistent.
Successful practice-shot hardware sequence
Your project decides which gamepad inputs request these actions. The simulator watches the resulting hardware state, not any particular button:
- Run the intake motor forward for about one second at full power. Its three roller stages carry the artifact all the way into the horizontal three-artifact magazine automatically.
- Position the robot so the cyan Practice trajectory passes through the raised goal opening.
- Command the launcher flywheel near
1900ticks per second and wait until its measured velocity is close to the target. - Move the positional
launcher_triggerservo from your configured rest position to your configured fire position for at least0.10seconds, then return it to rest. The visible pusher must lift the staged artifact into the flywheel before it can launch. Servo positions are normalized from0.0to1.0;1900is the flywheel motor velocity, not a servo position.
The transfer motor is not a normal magazine stage. It drives the small spinner beside the flywheel to help clear a blockage; running it is not required for an artifact that is flowing normally.
In Practice, either field goal counts. The scoring detector intentionally allows a little more room than the strict opening: an artifact also scores when it reaches the goal's back wall from above or passes through the invisible triangular catch region directly in front of the goal. After a hit or miss, its replacement returns to the same initial field side rather than appearing across the field.
FTC gamepad Y follows the SDK convention: pushing a stick up reports -1. Convert it to positive forward once in your Java drive code. The simulator does not apply another gamepad-axis negation.
Passed every challenge check?
Mark the unit mastered to record every lesson objective and continue directly to the next unit. 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.