-
Notifications
You must be signed in to change notification settings - Fork 0
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
Algae roller subsystem: intakeRoller and intakePivot #9
base: main
Are you sure you want to change the base?
Conversation
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.
Make sure you add the two imports. The other thing is fine if u leave it for now
import edu.wpi.first.wpilibj2.command.SubsystemBase; | ||
import com.revrobotics.CANSparkMax; | ||
import com.revrobotics.spark.SparkLowLevel.MotorType; | ||
|
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.
Make sure you add the imports(forgot to tell you while we were reviewing)
import com.revrobotics.CANSparkMax.IdleMode;
import com.revrobotics.CANSparkMaxLowLevel.MotorType;
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.
That second one is already present, while the first one is from the old version of REVLib.
|
||
import edu.wpi.first.wpilibj2.command.SubsystemBase; | ||
import com.revrobotics.CANSparkMax; | ||
import com.revrobotics.spark.SparkLowLevel.MotorType; |
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.
I think this is goofy vscode being dumb get rid of line 9 I think
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.
No, this is correct, leave it.
package frc.robot.subsystems.algaeIntake; | ||
|
||
import edu.wpi.first.wpilibj2.command.SubsystemBase; | ||
import com.revrobotics.CANSparkMax; |
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.
So, this is code for REVLib 2024. REV changed a lot of things in 2025, see https://docs.revrobotics.com/brushless/revlib/revlib-overview/migrating-to-revlib-2025. So CANSparkMax
should just be SparkMax
now, among other changes.
|
||
import edu.wpi.first.wpilibj2.command.SubsystemBase; | ||
import com.revrobotics.CANSparkMax; | ||
import com.revrobotics.spark.SparkLowLevel.MotorType; |
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.
No, this is correct, leave it.
import edu.wpi.first.wpilibj2.command.SubsystemBase; | ||
import com.revrobotics.CANSparkMax; | ||
import com.revrobotics.spark.SparkLowLevel.MotorType; | ||
|
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.
That second one is already present, while the first one is from the old version of REVLib.
intakeRoller.setIdleMode(IdleMode.kBrake); | ||
intakePivot.setIdleMode(IdleMode.kBrake); | ||
intakeRoller.setSmartCurrentLimit(40); | ||
intakePivot.setSmartCurrentLimit(40); | ||
intakeRoller.setInverted(false); | ||
intakePivot.setInverted(false); |
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.
Similarly, all of the configuration API has changed, see the link I sent above; send a message if you need help.
intakeRoller.stopMotor(); | ||
} | ||
|
||
public void stopIntakePivot(){ |
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.
Not really a major issue but it's a pet peeve of mine: there should be a space between the closing parenthesis and the opening curly brace. The code will work without it but it looks worse this way.
Added methods for intakeRoller and intakePivot. Closes #6