-
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
Spinner testing and related fixes #54
base: BranchForCodeReview1
Are you sure you want to change the base?
Conversation
// 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)))); | ||
|
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.
This shouldn't be merged to main so delete
// 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); |
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.
This shouldn't be merged to main so delete
/** | ||
* Call this method periodically. | ||
*/ | ||
public void periodic() { | ||
updateDashboard(); | ||
} | ||
} | ||
} |
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.
And I quote GitHub "No new line at end of file"
// */ | ||
// KFSum += (output * PIDF_MAX_OUTPUT) / averageVelocity; |
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.
delete
// */ | ||
// KFSum += (output * PIDF_MAX_OUTPUT) / averageVelocity; | ||
|
||
KFSum += output / averageVelocity; |
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.
You sure it isn't KFSum += (output * PIDF_MAX_OUTPUT) / averageVelocity;
?
motor.set(power); | ||
motor.setVoltage(power); |
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.
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); |
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.
spinnerSS.stopMoving();
consistency is key
@Override | ||
public boolean isFinished() { | ||
return 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.
can be deleted. I think...
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); |
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.
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); |
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.
Why is the default to use the logic since it causes issues?
No description provided.