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

Spinner testing and related fixes #54

Open
wants to merge 11 commits into
base: BranchForCodeReview1
Choose a base branch
from

Conversation

Mboesn
Copy link
Contributor

@Mboesn Mboesn commented Jul 5, 2021

No description provided.

Comment on lines 72 to 85
// Spinner testing

// driverXboxController.getButtonX().whenPressed(
// new InstantCommand(subsystemContainer.PITCHER_SS::toggleSolenoid, subsystemContainer.PITCHER_SS));
// driverXboxController.getButtonA().whileHeld(commandContainer.SHOOT_CMDGP.withInterrupt(this::cancelShooterCMD));
// SmartDashboard.putNumber("Spinner/VelPulse", robotConstants.spinnerConstants.DEFAULT_MOTOR_POWER);
// SmartDashboard.putNumber("Spinner/PulseLength", robotConstants.spinnerConstants.PULSE_LENGTH);
// SmartDashboard.putNumber("Intake/power", robotConstants.intakeConstants.DEFAULT_MOTOR_POWER);
// driverXboxController.getButtonB().whenHeld(new ParallelCommandGroup(new SpinInPulsesCMD(subsystemContainer.SPINNER_SS, robotConstants.spinnerConstants,
// () -> SmartDashboard.getNumber("Spinner/VelPulse", robotConstants.spinnerConstants.PULSE_MOTOR_POWER),
// () -> SmartDashboard.getNumber("Spinner/PulseLength", robotConstants.spinnerConstants.PULSE_LENGTH)),
// new IntakeCMD(subsystemContainer.INTAKE_SS, null, robotConstants.intakeConstants,
// () -> SmartDashboard.getNumber("Intake/power", robotConstants.intakeConstants.DEFAULT_MOTOR_POWER))));

Copy link
Contributor

Choose a reason for hiding this comment

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

This shouldn't be merged to main so delete

Comment on lines +100 to +114
// Spinner testing

// overrideXboxController.getButtonA().whenPressed(commandContainer.TOGGLE_PITCHER);
// overrideXboxController.getButtonB().whileHeld(new ShootWithoutLimelight(subsystemContainer, robotConstants, () -> 3500)).whenReleased(commandContainer.CLOSE_PITCHER);
// overrideXboxController.getButtonY().whileHeld(new ShootCMDGP(subsystemContainer, robotConstants,limelight, 3500));
// SmartDashboard.putNumber("Spinner/Vel", robotConstants.spinnerConstants.DEFAULT_MOTOR_POWER);
// SmartDashboard.putNumber("Loader/Vel", robotConstants.loaderConstants.DEFAULT_MIXING_VELOCITY);
// overrideXboxController.getLeftBumper().whileHeld(new ParallelCommandGroup(
// new LoaderCMD(subsystemContainer.LOADER_SS, robotConstants.loaderConstants,
// () -> subsystemContainer.SPINNER_SS.isStalled() ? 0
// : SmartDashboard.getNumber("Loader/Vel", robotConstants.loaderConstants.DEFAULT_MIXING_VELOCITY)),
// new SpinnerCMD(subsystemContainer.SPINNER_SS, robotConstants.spinnerConstants, () -> SmartDashboard.getNumber("Spinner/Vel", robotConstants.spinnerConstants.DEFAULT_MOTOR_POWER))));
// overrideXboxController.getLeftStickButton().whenPressed(new InstantCommand(() -> {SmartDashboard.putNumber("Spinner/Vel", SmartDashboard.getNumber("Spinner/Vel", robotConstants.spinnerConstants.DEFAULT_MOTOR_POWER) - 0.02);}));
// overrideXboxController.getRightStickButton().whenPressed(new InstantCommand(() -> {SmartDashboard.putNumber("Spinner/Vel", SmartDashboard.getNumber("Spinner/Vel", robotConstants.spinnerConstants.DEFAULT_MOTOR_POWER) + 0.02);}));
// overrideXboxController.getRightBumper().whenHeld(commandContainer.COLLECT_CMDGP).whenReleased(commandContainer.OPEN_INTAKE_CMD);
Copy link
Contributor

Choose a reason for hiding this comment

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

This shouldn't be merged to main so delete

/**
* Call this method periodically.
*/
public void periodic() {
updateDashboard();
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

And I quote GitHub "No new line at end of file"

Comment on lines +66 to +67
// */
// KFSum += (output * PIDF_MAX_OUTPUT) / averageVelocity;
Copy link
Contributor

Choose a reason for hiding this comment

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

delete

// */
// KFSum += (output * PIDF_MAX_OUTPUT) / averageVelocity;

KFSum += output / averageVelocity;
Copy link
Contributor

Choose a reason for hiding this comment

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

You sure it isn't KFSum += (output * PIDF_MAX_OUTPUT) / averageVelocity; ?

motor.set(power);
motor.setVoltage(power);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why isn't this giving an error? overriddenMove is inherited. if you change it it will complain that you don't have all inherited functions


@Override
public void end(boolean interrupted) {
spinnerSS.move(0);
Copy link
Contributor

Choose a reason for hiding this comment

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

spinnerSS.stopMoving(); consistency is key

Comment on lines +53 to +56
@Override
public boolean isFinished() {
return false;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

can be deleted. I think...

Comment on lines +17 to +30
public SpinInPulsesCMD(SpinnerSS spinnerSS, SpinnerConstants constants, DoubleSupplier power, DoubleSupplier pulseLength) {
this.spinnerSS = spinnerSS;
this.constants = constants;
this.power = power;
this.pulseLength = pulseLength;
addRequirements(spinnerSS);
}

public SpinInPulsesCMD(SpinnerSS spinnerSS, SpinnerConstants constants, DoubleSupplier power) {
this(spinnerSS, constants, power, () -> constants.PULSE_LENGTH);
}

public SpinInPulsesCMD(SpinnerSS spinnerSS, SpinnerConstants constants) {
this(spinnerSS, constants, () -> constants.PULSE_MOTOR_POWER);
Copy link
Contributor

Choose a reason for hiding this comment

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

What about a supplier that takes pulseLenth but uses default power?

addRequirements(spinnerSS);
}

public SpinnerCMD(SpinnerSS spinnerSS, SpinnerConstants constants, DoubleSupplier power) {
this(spinnerSS, constants, power, true);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is the default to use the logic since it causes issues?

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