Skip to content

create_rotors_subsystem - #3

Merged
jaymendo670-png merged 11 commits into
mainfrom
create-rotor-subsystem
May 23, 2026
Merged

create_rotors_subsystem#3
jaymendo670-png merged 11 commits into
mainfrom
create-rotor-subsystem

Conversation

@FRCTeam3255-Shared-K1-10

Copy link
Copy Markdown
Contributor

James
Justin

@TaylerUva

Copy link
Copy Markdown
Member

Be sure to make the pull request name more specific. "I did..." is not a good naming convention since it has extra words that don't add anything"

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Rotors subsystem intended to manage multiple TalonFX-driven rollers/flywheels, along with the CAN IDs and placeholder TalonFX configurations needed to configure those motors.

Changes:

  • Introduces Rotors subsystem with TalonFX instances, config application, getters, and setters.
  • Adds rotor-related CAN IDs to DeviceIDs.rotorIDs.
  • Adds ConstRotors with TalonFXConfiguration placeholders for each rotor motor.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.

File Description
src/main/java/frc/robot/subsystems/Rotors.java Implements the new rotor subsystem (motor objects, configuration, getters/setters).
src/main/java/frc/robot/DeviceIDs.java Defines CAN IDs for the rotor subsystem motors.
src/main/java/frc/robot/constants/ConstRotors.java Adds configuration constants intended to be applied to rotor TalonFX devices.

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

Comment on lines +24 to +25
final TalonFX flywheelRollersEast = new TalonFX((rotorIDs.FLYWHEEL_EAST_FOLLOWER));
final TalonFX flywheelWestFollower = new TalonFX((rotorIDs.TRANSFER_ROLLERS_WEST_CAN));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please do

Comment on lines +32 to +36
intakeRollersWest.getConfigurator().apply(ConstRotors.FLYWHEEL_ROLLERS_WEST_CONFIGURATION);
transferRollersEast.getConfigurator().apply(ConstRotors.TRANSFER_ROLLERS_EAST_CONFIGURATION);
transferRollersWest.getConfigurator().apply(ConstRotors.TRANSFER_ROLLERS_WEST_CONFIGURATION);
flywheelRollersEast.getConfigurator().apply(ConstRotors.FLYWHEEL_ROLLERS_EAST_CONFIGURATION);
flywheelRollersEast.getConfigurator().apply(ConstRotors.FLYWHEEL_ROLLERS_EAST_CONFIGURATION);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please do

Comment on lines +48 to +76
return serializerRollers.getVelocity().getValue();
}

public AngularVelocity getIntakeRollersWest() {
return serializerRollers.getVelocity().getValue();
}

public AngularVelocity getTransferRollersEast() {
return serializerRollers.getVelocity().getValue();
}

public AngularVelocity getTransferRollersWest() {
return serializerRollers.getVelocity().getValue();
}

public AngularVelocity getFlywheelRollersEast() {
return serializerRollers.getVelocity().getValue();
}

public AngularVelocity getFlywheelRollersWest() {
return serializerRollers.getVelocity().getValue();
}

public AngularVelocity getFlywheelEastFollower() {
return serializerRollers.getVelocity().getValue();
}

public AngularVelocity getFlywheelWestFollower() {
return serializerRollers.getVelocity().getValue();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please do

Comment on lines +85 to +90
intakeRollersWest.set(speed);

}

public void intakeRollersWest(double speed) {
intakeRollersEast.set(speed);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please do

Comment on lines +104 to +116
public void flywheelRollersEast(double speed) {
flywheelEastFollower.set(speed);

}

public void flywheelRollersWest(double speed) {
flywheelRollersWest.set(speed);

}

public void flywheelWestFollower(double speed) {
flywheelRollersWest.set(speed);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please do

Comment thread src/main/java/frc/robot/DeviceIDs.java Outdated
Comment on lines 48 to 50
public static final int FLYWHEEL_WEST_FOLLOWER = 18;
public static final int FLYWHEEL_EAST_FOLLOWER = 19;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please do

import edu.wpi.first.epilogue.Logged;
import edu.wpi.first.units.measure.AngularVelocity;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.DeviceIDs;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please do

@TaylerUva TaylerUva left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

good so far, check requested changes

Comment on lines +23 to +24
final TalonFX flywheelRollersWest = new TalonFX((rotorIDs.FLYWHEEL_ROLLERS_WEST_CAN));
final TalonFX flywheelRollersEast = new TalonFX((rotorIDs.FLYWHEEL_EAST_FOLLOWER));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

what are flywheel rollers?


}

public AngularVelocity getSerializerRollers() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

what about the rollert? what are we getting from the roller? this applies to all your get* functions


}

public void intakeRollersEast(double speed) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

what are we doing to intakeRollersEast? look at your other functions too

@TaylerUva TaylerUva left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Remember to pay attention to key details, like making sure names align, a lot of mismatches were caught and these could physically break the robot

return serializerRollers.getVelocity().getValue();
}

public AngularVelocity getIntakeRollersEastVelocity() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Don't need a accessor method for every motor, like getIntakeRollersEast/WestVelocity should be replaced by a single getIntakeRollersVelocity where only gets the master motor. this same issue happened multiple times in this same file.

Comment on lines 81 to 111
public void intakeRollersEastSpeed(double speed) {
intakeRollersEast.set(speed);
}

public void intakeRollersWestSpeed(double speed) {
intakeRollersWest.set(speed);
}

public void transferRollersEastSpeed(double speed) {
transferRollersEast.set(speed);
}

public void transferRollersWestSpeed(double speed) {
transferRollersWest.set(speed);
}

public void flywheelEastSpeed(double speed) {
flywheelEast.set(speed);
}

public void flywheelWestSpeed(double speed) {
flywheelWest.set(speed);
}

public void flywheelWestFollowerSpeed(double speed) {
flywheelWestFollower.set(speed);
}

public void flywheelEastFollowerSpeed(double speed) {
flywheelEastFollower.set(speed);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

  1. add word "set" to all setter methods
  2. you set all motors in the same function. like setIntakeRollersSpeed should set both east and west motors, the follower should be using: setControl([theFollowerInstance])

final TalonFX flywheelWest = new TalonFX((rotorIDs.FLYWHEEL_WEST_CAN));
final TalonFX flywheelEast = new TalonFX((rotorIDs.FLYWHEEL_EAST_CAN));
final TalonFX flywheelWestFollower = new TalonFX((rotorIDs.FLYWHEEL_WEST_FOLLOWER_CAN));
final TalonFX flywheelEastFollower = new TalonFX(rotorIDs.FLYWHEEL_EAST_FOLLOWER_CAN);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

need to add followers; examples: Follower flywheelEastFollower = new Follower(flywheelTopEast.getDeviceID(), MotorAlignmentValue.Aligned);

public static final TalonFXConfiguration INTAKE_ROLLERS_WEST_CONFIGURATION = new TalonFXConfiguration();
public static final TalonFXConfiguration TRANSFER_ROLLERS_EAST_CONFIGURATION = new TalonFXConfiguration();
public static final TalonFXConfiguration TRANSFER_ROLLERS_WEST_CONFIGURATION = new TalonFXConfiguration();
public static final TalonFXConfiguration FLYWHEEL_EAST_FOLLOWER_CONFIGURATION = new TalonFXConfiguration();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

dont need this

public static final TalonFXConfiguration FLYWHEEL_EAST_FOLLOWER_CONFIGURATION = new TalonFXConfiguration();
public static final TalonFXConfiguration FLYWHEEL_EAST_CONFIGURATION = new TalonFXConfiguration();
public static final TalonFXConfiguration FLYWHEEL_WEST_CONFIGURATION = new TalonFXConfiguration();
public static final TalonFXConfiguration FLYWHEEL_WEST_FOLLOWER_CONFIGURATION = new TalonFXConfiguration();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

sont need this

public static final TalonFXConfiguration FLYWHEEL_WEST_FOLLOWER_CONFIGURATION = new TalonFXConfiguration();

public static final double STOP = 0;

@Wu-Fan-529 Wu-Fan-529 May 23, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

all of your configurations are empty, you need to add:

    CONFIG.MotorOutput.NeutralMode = NeutralModeValue.Brake;

    CONFIG.MotorOutput.Inverted = InvertedValue.Clockwise_Positive;

    CONFIG.CurrentLimits.SupplyCurrentLimitEnable = true;

    CONFIG.CurrentLimits.SupplyCurrentLowerLimit = 35;

for all configurators

@FRCTeam3255-Shared-K1-10 FRCTeam3255-Shared-K1-10 changed the title I created roters subsytem create_rotors_subsystem May 23, 2026
added configurationhs
AngularVelocity lastDesiredFlyWheelSpeed = Units.RPM.of(0);
AngularVelocity lastDesiredTransferRollersSpeed = Units.RPM.of(0);
Follower flywheelEastFollower = new Follower(flywheelTopEast.getDeviceID(), false);
Follower flywheelWestFollower = new Follower(flywheelTopWest.getDeviceID(), false);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

both west flywheel motors should be following top east, and flywheelWestFollower should be:
Follower flywheelWestFollower = new Follower(flywheelTopEast.getDeviceID(), MotorAlignmentValue.Opposed);

Comment on lines +74 to +80
public AngularVelocity getFlywheelEastVelocity() {
return flywheelTopEast.getVelocity().getValue();
}

public AngularVelocity getFlywheelWestVelocity() {
return flywheelTopWest.getVelocity().getValue();
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should combine both and only get east


public void setFlywheelSpeeds(AngularVelocity speed) {
flywheelTopEast.setControl(flyWheelVelocityRequest.withVelocity(speed));
flywheelTopWest.setControl(flyWheelVelocityRequest.withVelocity(speed));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

use follower

Comment thread src/main/java/frc/robot/subsystems/Rotors.java
fixxed comments

@Wu-Fan-529 Wu-Fan-529 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks fine to me

return transferRollersEast.getVelocity().getValue();
}

public AngularVelocity getFlywheelEastVelocity() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Doesn't getFlyWheelSpeeds() already cover this?

Fixed Angela's comment

Co-Authored-By: Justinpham17386769 <244249272+Justinpham17386769@users.noreply.github.com>
Co-Authored-By: jayden mendoza <244560677+jaymendo670-png@users.noreply.github.com>
@jaymendo670-png
jaymendo670-png merged commit 6a32b34 into main May 23, 2026
1 check passed
@jaymendo670-png
jaymendo670-png deleted the create-rotor-subsystem branch May 23, 2026 22:57
@TaylerUva TaylerUva linked an issue May 24, 2026 that may be closed by this pull request
4 tasks
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.

Create rotor subsystem

8 participants