Created my first OpMode for Mecanum Drive#31
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new learning OpMode for mecanum drive control, created by Chase. It follows the established pattern of other learning OpModes in the team's repository, using the Constants class for motor names and implementing basic field-centric mecanum drive kinematics.
- Uses Constants class for motor name configuration
- Implements standard mecanum drive kinematics with joystick control
- Sets motor directions for proper mecanum drive operation
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| @Override | ||
| public void loop() { | ||
| double y = gamepad1.left_stick_y; |
There was a problem hiding this comment.
The Y-axis should be negated. In FTC, the gamepad's left_stick_y returns negative values when pushed forward. Other learning OpModes in this directory (BrodysFIRSTOpMode.java and NicksFIRSTJavaOpMode.java) use -gamepad1.left_stick_y to ensure pushing the stick forward makes the robot move forward. Without negation, the robot will move backward when the stick is pushed forward.
| double y = gamepad1.left_stick_y; | |
| double y = -gamepad1.left_stick_y; |
|
|
||
| import org.firstinspires.ftc.teamcode.Constants; | ||
|
|
||
| @TeleOp(name="Chase's OpMode", group = "Example OpMode") |
There was a problem hiding this comment.
Missing @disabled annotation. All other learning OpModes (BrodysFIRSTOpMode.java and NicksFIRSTJavaOpMode.java) include the @disabled annotation to prevent accidental selection during competition. Add @Disabled on line 11 before the class declaration for consistency with the team's learning OpMode pattern.
| @TeleOp(name="Chase's OpMode", group = "Example OpMode") | |
| @TeleOp(name="Chase's OpMode", group = "Example OpMode") | |
| @com.qualcomm.robotcore.eventloop.opmode.Disabled |
|
|
||
| telemetry.addData("Status", "Running"); | ||
| telemetry.update(); | ||
| } |
There was a problem hiding this comment.
[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(); | |
| } |
Before issuing a pull request: