Skip to content

Conversation

@Niosocket11
Copy link

Please merge this tim, it works

For some reason all the files were not in lib199 but only in carlmontrobotics
Removed state enum cause did not able to work nicely how I thought
Created a detailed plug and play common mechs that allow programming not to waste time reinventing the wheel each year
@Niosocket11 Niosocket11 requested a review from timtogan January 9, 2026 03:40
@Niosocket11 Niosocket11 requested a review from a team as a code owner January 9, 2026 03:40
Copy link
Member

@timtogan timtogan left a comment

Choose a reason for hiding this comment

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

This looks pretty good! I mostly skimed over the code, so I'll prob do another review when I have time. Also fyi, some comments I left only for one mech but it can be applied to (all) other mechs as well

* @param armKPID double array with 3 values, kP, kI, kD
* @param bottomLimit lowest angle in degrees the arm can safely achieve with 0 being horizontal
* @param topLimit highest angle in degrees the arm can safely achieve with 0 being horizontal
* @throws IllegalArgumentException if MotorType is not one of the 3 expected {@link MotorConfig}s
Copy link
Member

Choose a reason for hiding this comment

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

5 as we added solo vortexes and neo 2.0

armKP = 0;
armKI = 0;
armKD = 0;
DriverStation.reportWarning("ArmPID is off", true);
Copy link
Member

Choose a reason for hiding this comment

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

I would print why ArmPID is off, ie ArmPID is off because KP is less than 0

armKG = 0;
armKV = 0;
armKA = 0;
DriverStation.reportWarning("ArmFeedForward is off", true);
Copy link
Member

Choose a reason for hiding this comment

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

same here

* @throws IllegalArgumentException if the bottom limit is higher or equal to the top limit
*/
public static ArmConfig motorWithPID(int armMasterMotorId, MotorConfig armMasterMotorType, boolean armMasterInversed, double[] armKPID, double bottomLimit, double topLimit) {
return new ArmConfig(1, 1, 14, null, null, null, armMasterMotorId, armMasterMotorType, armMasterInversed, armKPID, defaultArmPIDTolerance, false, null, null, -1, 0, bottomLimit, topLimit);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return new ArmConfig(1, 1, 14, null, null, null, armMasterMotorId, armMasterMotorType, armMasterInversed, armKPID, defaultArmPIDTolerance, false, null, null, -1, 0, bottomLimit, topLimit);
return new ArmConfig(1, 1, 12, null, null, null, armMasterMotorId, armMasterMotorType, armMasterInversed, armKPID, defaultArmPIDTolerance, false, null, null, -1, 0, bottomLimit, topLimit);

}

/**
* Checks PID to have 3 values, updates {@link #armPIDExists} and makes sure the values are legitimate
Copy link
Member

Choose a reason for hiding this comment

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

what is armPIDExists, I can't find it refrenced anywhere but in here

Comment on lines +917 to +924
/**
* @deprecated Use {@link #resetFieldOrientation()} instead
*/
@Deprecated
public void resetHeading() {
gyro.reset();

}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/**
* @deprecated Use {@link #resetFieldOrientation()} instead
*/
@Deprecated
public void resetHeading() {
gyro.reset();
}

Comment on lines +1001 to +1025
/**
* @deprecated Use {@link #setMode(Mode)} instead
* Changes between IdleModes
*/
@Deprecated
public void toggleMode() {
for (SwerveModule module : modules)
module.toggleMode();
}
/**
* @deprecated Use {@link #setMode(Mode)} instead
*/
@Deprecated
public void brake() {
for (SwerveModule module : modules)
module.brake();
}
/**
* @deprecated Use {@link #setMode(Mode)} instead
*/
@Deprecated
public void coast() {
for (SwerveModule module : modules)
module.coast();
}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/**
* @deprecated Use {@link #setMode(Mode)} instead
* Changes between IdleModes
*/
@Deprecated
public void toggleMode() {
for (SwerveModule module : modules)
module.toggleMode();
}
/**
* @deprecated Use {@link #setMode(Mode)} instead
*/
@Deprecated
public void brake() {
for (SwerveModule module : modules)
module.brake();
}
/**
* @deprecated Use {@link #setMode(Mode)} instead
*/
@Deprecated
public void coast() {
for (SwerveModule module : modules)
module.coast();
}

if (armFollowId != null) {
for (MotorConfig config: armFollowMotorType) {
if (config != MotorConfig.NEO && config != MotorConfig.NEO_VORTEX && config != MotorConfig.NEO_550) {
throw new IllegalArgumentException("What is this config??? If null pls change, if not null you're cooked");
Copy link
Member

Choose a reason for hiding this comment

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

maybe it's a neo 2.0 or a solo vortex :P

Copy link
Member

Choose a reason for hiding this comment

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

also I feel like this is not really needed, as I don't nesseceraly see how this is better than a null check and it adds burden, as you need to modify this whenever a motor is added to motorConfig

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.

3 participants