-
Notifications
You must be signed in to change notification settings - Fork 0
Created my first OpMode for Mecanum Drive #31
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,51 @@ | ||||||||||||||||||
| package org.firstinspires.ftc.teamcode.OpModes.learning; | ||||||||||||||||||
|
|
||||||||||||||||||
| import com.qualcomm.robotcore.eventloop.opmode.OpMode; | ||||||||||||||||||
| import com.qualcomm.robotcore.eventloop.opmode.TeleOp; | ||||||||||||||||||
| import com.qualcomm.robotcore.hardware.DcMotor; | ||||||||||||||||||
| import com.qualcomm.robotcore.hardware.DcMotorSimple; | ||||||||||||||||||
|
|
||||||||||||||||||
| import org.firstinspires.ftc.teamcode.Constants; | ||||||||||||||||||
|
|
||||||||||||||||||
| @TeleOp(name="Chase's OpMode", group = "Example OpMode") | ||||||||||||||||||
| public class ChaseFirstOpMode extends OpMode { | ||||||||||||||||||
| private DcMotor frontLeftMotor; | ||||||||||||||||||
| private DcMotor frontRightMotor; | ||||||||||||||||||
| private DcMotor backLeftMotor; | ||||||||||||||||||
| private DcMotor backRightMotor; | ||||||||||||||||||
|
|
||||||||||||||||||
| @Override | ||||||||||||||||||
| public void init() { | ||||||||||||||||||
| frontLeftMotor = hardwareMap.get(DcMotor.class, Constants.Drivetrain.flMotorName); | ||||||||||||||||||
| frontRightMotor = hardwareMap.get(DcMotor.class, Constants.Drivetrain.frMotorName); | ||||||||||||||||||
| backLeftMotor = hardwareMap.get(DcMotor.class, Constants.Drivetrain.blMotorName); | ||||||||||||||||||
| backRightMotor = hardwareMap.get(DcMotor.class, Constants.Drivetrain.brMotorName); | ||||||||||||||||||
|
|
||||||||||||||||||
| frontLeftMotor.setDirection(DcMotorSimple.Direction.REVERSE); | ||||||||||||||||||
| backLeftMotor.setDirection(DcMotorSimple.Direction.REVERSE); | ||||||||||||||||||
|
|
||||||||||||||||||
| telemetry.addData("Status", "Initialized"); | ||||||||||||||||||
| telemetry.update(); | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| @Override | ||||||||||||||||||
| public void loop() { | ||||||||||||||||||
| double y = gamepad1.left_stick_y; | ||||||||||||||||||
|
||||||||||||||||||
| double y = gamepad1.left_stick_y; | |
| double y = -gamepad1.left_stick_y; |
Copilot
AI
Nov 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Missing stop() method override. For consistency with other learning OpModes in this directory, consider adding a stop() method that updates telemetry status to 'Stopped', similar to BrodysFIRSTOpMode.java and NicksFIRSTJavaOpMode.java. This helps students understand the complete OpMode lifecycle.
| } | |
| } | |
| @Override | |
| public void stop() { | |
| telemetry.addData("Status", "Stopped"); | |
| telemetry.update(); | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing @disabled annotation. All other learning OpModes (BrodysFIRSTOpMode.java and NicksFIRSTJavaOpMode.java) include the @disabled annotation to prevent accidental selection during competition. Add
@Disabledon line 11 before the class declaration for consistency with the team's learning OpMode pattern.