Skip to content

Conversation

@ngarnsworthy
Copy link
Collaborator

Before issuing a pull request, please see the contributing page.

Added the new subsystem and command.
Fixed PrimaryOpMode to be proper type.
Copilot AI review requested due to automatic review settings October 23, 2025 01:04
@ngarnsworthy ngarnsworthy linked an issue Oct 23, 2025 that may be closed by this pull request
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the drivetrain implementation into a dedicated subsystem following the command-based architecture pattern. The changes improve code organization by separating concerns and establishing proper command-subsystem relationships.

Key Changes:

  • Created a new Drivetrain subsystem to encapsulate motor management and drive logic
  • Implemented UserDrive command to handle driver input for the drivetrain
  • Converted PrimaryOpMode from OpMode to CommandOpMode to support the command-based architecture

Reviewed Changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Drivetrain.java New subsystem class that encapsulates four mecanum drive motors and provides movement methods
UserDrive.java New command that binds gamepad input to drivetrain movement
PrimaryOpMode.java Refactored to use CommandOpMode with subsystem/command architecture instead of direct motor control in loop()
Shooter.java Made shooterMotor field final for immutability
RunShooter.java Made fields final and removed redundant isFinished() override
readme.md Minor formatting improvements to documentation
Comments suppressed due to low confidence (1)

TeamCode/src/main/java/org/firstinspires/ftc/teamcode/PrimaryOpMode.java:1

  • The rotation parameter uses getRightY() but the original code used getRightX() for rotation. This changes the control scheme from right stick horizontal movement to vertical movement for rotation, which is likely unintended.
package org.firstinspires.ftc.teamcode;

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ngarnsworthy ngarnsworthy requested a review from Copilot October 23, 2025 01:05
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Collaborator Author

@ngarnsworthy ngarnsworthy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything should work

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ngarnsworthy ngarnsworthy requested a review from Copilot October 23, 2025 01:09
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@ngarnsworthy ngarnsworthy requested a review from Copilot October 23, 2025 13:17
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

driverOp = new GamepadEx(gamepad1);
coOp = new GamepadEx(gamepad2);

drivetrain = new Drivetrain(hardwareMap, "frontLeftDrive", "frontRightDrive", "backLeftDrive", "backRightDrive");
Copy link

Copilot AI Oct 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The motor names are duplicated between PrimaryOpMode and BackupOpMode. Consider extracting these as constants to a shared configuration class to ensure consistency and ease maintenance.

Copilot uses AI. Check for mistakes.
@ngarnsworthy ngarnsworthy requested a review from Copilot October 23, 2025 13:35
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Member

@naterbots naterbots left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment about RunShooter command

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@ngarnsworthy ngarnsworthy requested a review from Copilot October 24, 2025 16:33
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@naterbots naterbots left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ngarnsworthy, what is the difference between Primary Op Mode and Backup Op Mode?

@ngarnsworthy
Copy link
Collaborator Author

ngarnsworthy commented Oct 25, 2025

@naterbots Currently nothing but the idea is if we add vision, field centric, etc. those would only be in primary op mode and we could fall back to to backup if any issues popped up like they did at FRC last year.

@ngarnsworthy ngarnsworthy merged commit 9f93c24 into master Oct 25, 2025
1 check passed
@ngarnsworthy ngarnsworthy deleted the 14-move-drivetrain-into-subsystem branch October 25, 2025 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move drivetrain into subsystem

3 participants