Skip to content

Commit

Permalink
spelling mistake and reverseintakeflywheel
Browse files Browse the repository at this point in the history
  • Loading branch information
JadedHearth committed Sep 19, 2024
1 parent 48329fc commit 0bfb71c
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import frc.robot.commands.Positions.SpeakerShot;
import frc.robot.commands.Positions.StowPosition;
import frc.robot.commands.PreRunShooter;
import frc.robot.commands.ReverseIntakeFlywheel;
import frc.robot.commands.ShootNote;
import frc.robot.commands.ShootNoteTeleop;
import frc.robot.subsystems.arm.Arm;
Expand Down Expand Up @@ -73,8 +74,6 @@ public class RobotContainer {
// Subsystems
private final Drive sDrive;
private final Flywheel sFlywheel;
private final Flywheel sEject;
private final Intake sOutake;
private final Intake sIntake;
private final Arm sArm;

Expand Down Expand Up @@ -338,7 +337,8 @@ private void configureButtonBindings() {
new PreRunShooter(sFlywheel, true, sIntake)); // Runs the flywheel slowly at all times

operatorController.rightBumper().whileTrue(new ShootNoteTeleop(sIntake, sFlywheel, sArm));
operatorController.leftBumper().whileTrue(new ShootNoteTeleop(sOutake, sEject, sArm));
// operatorController.leftBumper().whileTrue(new PreRunShooter(sFlywheel, sIntake));
operatorController.leftBumper().whileTrue(new ReverseIntakeFlywheel(sIntake, sFlywheel));

// Climber controls (The first one is 90% probably the one that works.)
// sClimber.setDefaultCommand(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static Command intakeShooterDefaultCommand(
intake.runPercentSpeed(
Constants.IntakeConstants.percentPower * rightTriggerSupplier.getAsDouble());
}
boolean noteDetected = intake.getConveyerProximity() || intake.getShooterProximity();
boolean noteDetected = intake.getConveyorProximity() || intake.getShooterProximity();
SmartDashboard.putBoolean("Note Detected", noteDetected);
},
intake);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/commands/IntakeNote.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void initialize() {}
@Override
public void execute() {

if (intake.getConveyerProximity()) {
if (intake.getConveyorProximity()) {
intake.runPercentSpeed(0);
} else {
intake.runPercentSpeed(-Constants.IntakeConstants.percentPower);
Expand All @@ -51,6 +51,6 @@ public void end(boolean interrupted) {

@Override
public boolean isFinished() {
return intake.getConveyerProximity();
return intake.getConveyorProximity();
}
}
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/commands/IntakeNoteAndAlign.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void initialize() {}
@Override
public void execute() {

if (intake.getConveyerProximity()) {
if (intake.getConveyorProximity()) {
intake.runPercentSpeed(0);
} else {
intake.runPercentSpeed(-Constants.IntakeConstants.percentPower);
Expand All @@ -51,6 +51,6 @@ public void end(boolean interrupted) {

@Override
public boolean isFinished() {
return intake.getConveyerProximity();
return intake.getConveyorProximity();
}
}
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/commands/PreRunShooter.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void execute() {
flywheel.runVelocity(-10000);

} else if (slowerDefault) {
if (intake.getConveyerProximity()) {
if (intake.getConveyorProximity()) {
flywheel.runVelocity(Constants.FlywheelConstants.slowShootingVelocity);
} else {
flywheel.runVelocity(300);
Expand Down
47 changes: 47 additions & 0 deletions src/main/java/frc/robot/commands/ReverseIntakeFlywheel.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Copyright 2016-2024 FRC 5829
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// version 3 as published by the Free Software Foundation or
// available in the root directory of this project.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

package frc.robot.commands;

import edu.wpi.first.wpilibj2.command.Command;
import frc.robot.Constants;
import frc.robot.subsystems.flywheel.Flywheel;
import frc.robot.subsystems.intake.Intake;

public class ReverseIntakeFlywheel extends Command {

private Intake intake;
private Flywheel flywheel;

public ReverseIntakeFlywheel(Intake intake, Flywheel flywheel) {
this.intake = intake;
this.flywheel = flywheel;
addRequirements(intake, flywheel);
}

@Override
public void initialize() {}

@Override
public void execute() {
double targetRPM = -Constants.FlywheelConstants.slowShootingVelocity;

flywheel.runVelocity(targetRPM);
intake.runPercentSpeed(1);
}

@Override
public void end(boolean interrupted) {
flywheel.runVelocity(0);
intake.runPercentSpeed(0);
}
}
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/commands/ShootNote.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public void execute() {
intake.runPercentSpeed(-1);
}

if (!intake.getConveyerProximity() && !intake.getShooterProximity()) {
if (!intake.getConveyorProximity() && !intake.getShooterProximity()) {
if (sensorsZeroTime == null) {
sensorsZeroTime = System.currentTimeMillis();
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/subsystems/LedSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void setDisco() {

@Override
public void periodic() {
boolean noteDetected = intake.getConveyerProximity() || intake.getShooterProximity();
boolean noteDetected = intake.getConveyorProximity() || intake.getShooterProximity();
SmartDashboard.putBoolean("Note Detected", noteDetected);
if (noteDetected) {
setColor(new int[] {0, 255, 0});
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/subsystems/intake/Intake.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void runPercentSpeed(double percentSpeed) {
Logger.recordOutput("Intake/PercentSpeed", percentSpeed);
}

public boolean getConveyerProximity() {
public boolean getConveyorProximity() {
return proximitySensorInputs.isConveyorSensorTriggered;
}

Expand Down

0 comments on commit 0bfb71c

Please sign in to comment.