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

Tracks how long for the motor to reach setpoint #125

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

Conversation

Nicholas-Stokes
Copy link
Contributor

No description provided.

Copy link
Contributor

@ZachOrr ZachOrr left a comment

Choose a reason for hiding this comment

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

I think this works. Would also wanna see some formatting cleanup before this gets landed but - the approach seems like it'd work.

src/main/java/frc/robot/commands/shooter/StartShooter.java Outdated Show resolved Hide resolved
src/main/java/frc/robot/commands/shooter/StartShooter.java Outdated Show resolved Hide resolved
src/main/java/frc/robot/subsystems/Shooter.java Outdated Show resolved Hide resolved
src/main/java/frc/robot/commands/shooter/StartShooter.java Outdated Show resolved Hide resolved
src/main/java/frc/robot/commands/shooter/StartShooter.java Outdated Show resolved Hide resolved
Copy link
Contributor

@ZachOrr ZachOrr left a comment

Choose a reason for hiding this comment

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

Left inline comments!

@Override
public void execute() {
shooter.setSpeed(shooter.shooterSpeedFeetPerSecondWidget.getDouble(0));
double targetSetpoint = shooter.shooterSpeedFeetPerSecondWidget.getDouble(0);
newSetpoint = targetSetpoint;
Copy link
Contributor

Choose a reason for hiding this comment

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

So if we're never resetting our reachSetpointCycleCounter or isShooterComingUpToSpeed - do we need to have a previous/next here? Or can we just have the single setpoint?

Doing the zeroing/resetting the way you were doing is fine. You'd only have to move your SmartDashboard.putNumber back in to that if (isShooterComingUpToSpeed block for that to still work.

Either approach is fine here IMO. I don't know if at this point in time we'll be like, holding the button to start the shooter and changing the values on the slider. I think it's more likely we'll set the value in code and then want to see how long the shooter takes to get up to speed between StartShooter calls.

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.

2 participants