Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Lauraleam1a
Copy link

@Lauraleam1a Lauraleam1a commented Jan 20, 2025

Added methods for intakeRoller and intakePivot. Closes #6

Copy link

@ChiliRhino417 ChiliRhino417 left a 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;

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;

Copy link
Member

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;

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

Copy link
Member

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;
Copy link
Member

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;
Copy link
Member

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;

Copy link
Member

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.

Comment on lines +18 to +23
intakeRoller.setIdleMode(IdleMode.kBrake);
intakePivot.setIdleMode(IdleMode.kBrake);
intakeRoller.setSmartCurrentLimit(40);
intakePivot.setSmartCurrentLimit(40);
intakeRoller.setInverted(false);
intakePivot.setInverted(false);
Copy link
Member

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(){
Copy link
Member

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.

@pigrammer3
Copy link
Member

Additionally, notice how I edited your PR to say "closes #6". That way when this PR is merged #6 will automatically be closed. It also helps for organization.

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 algae roller subsystem
3 participants