Skip to content

Commit

Permalink
First Deploy Testing and Debug (#83)
Browse files Browse the repository at this point in the history
* Tested speeds for intake, stager, hopper, and shooter

* Tuned Spiral Motor Speed

* Update RobotContainer.java

---------

Co-authored-by: FRCTeam3255-Shared <170778697+FRCTeam3255-Shared@users.noreply.github.com>
Co-authored-by: Evan Grinnell <155865196+S0L0GUY@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 27, 2024
1 parent 2749723 commit abcf41a
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 22 deletions.
14 changes: 7 additions & 7 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,25 @@ public static class constLED {
}

public static class constIntake {
public static final double INTAKE_EJECT_VELOCITY = -0.5;
public static final double INTAKE_VELOCITY = 0.5;
public static final double INTAKE_EJECT_VELOCITY = 1;
public static final double INTAKE_VELOCITY = -1;
}

public static class constHopper {
public static final double HOPPER_ORIENTATION_SPEED = 0.5;
public static final double HOPPER_ORIENTATION_SPEED = 1;
}

public static class constShooter {
public static final double PROPEL_MOTOR_VELOCITY = 0.6;
public static final double SPIRAL_MOTOR_VELOCITY = 0.8;
public static final double PROPEL_MOTOR_VELOCITY = -0.8;
public static final double SPIRAL_MOTOR_VELOCITY = 0.9;
public static final double PROPEL_MOTOR_VELOCITY_EJECT = 0.3;
public static final double SPIRAL_MOTOR_VELOCITY_EJECT = 0.3;
public static final double PROPEL_MOTOR_VELOCITY_EJECT_REQUIREMENT = 0.2;
public static final double SPIRAL_MOTOR_VELOCITY_EJECT_REQUIREMENT = 0.2;
}

public static class constStager {
public static final double STAGER_MOTOR_VELOCITY = 0.3;
public static final double TOP_STAGER_MOTOR_VELOCITY = 0.3;
public static final double STAGER_MOTOR_VELOCITY = -.8;
public static final double TOP_STAGER_MOTOR_VELOCITY = -.8;
}
}
9 changes: 6 additions & 3 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import frc.robot.subsystems.LED;
import frc.robot.subsystems.Shooter;
import frc.robot.subsystems.Stager;
import frc.robot.commands.EjectGP;

public class RobotContainer {
private final SN_XboxController m_driverController = new SN_XboxController(RobotMap.mapControllers.DRIVER_USB);
Expand All @@ -32,6 +33,7 @@ public class RobotContainer {
private final Shoot com_Shoot = new Shoot(subStager, subShooter, subLED);
private final intakeHopper com_IntakeHopper = new intakeHopper(subHopper, subStager, subLED);
private final EjectShooter com_EjectShooter = new EjectShooter(subStager, subShooter, subLED);
private final EjectGP com_EjectGP = new EjectGP(subIntake, subLED);

public RobotContainer() {
subDrivetrain.setDefaultCommand(com_Drive);
Expand All @@ -42,10 +44,11 @@ public RobotContainer() {

private void configureBindings() {
m_driverController.btn_LeftTrigger.whileTrue(com_IntakeGround);
m_driverController.btn_A.onTrue(com_PrepShooter);
m_driverController.btn_A.whileTrue(com_PrepShooter);
m_driverController.btn_B.whileTrue(com_IntakeHopper);
m_driverController.btn_LeftBumper.whileTrue(com_EjectShooter);
m_driverController.btn_RightTrigger.onTrue(com_Shoot);
m_driverController.btn_RightBumper.whileTrue(com_EjectShooter);
m_driverController.btn_RightTrigger.whileTrue(com_Shoot);
m_driverController.btn_LeftBumper.whileTrue(com_EjectGP);

}

Expand Down
22 changes: 12 additions & 10 deletions src/main/java/frc/robot/commands/Shoot.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,18 @@ public Shoot(Stager passedStager, Shooter passedShooter, LED shootLED) {
// Called when the command is initially scheduled.
@Override
public void initialize() {
globalShooter.setPropelMotorVelocity(Constants.constShooter.PROPEL_MOTOR_VELOCITY);
globalShooter.setSpiralMotorVelocity(Constants.constShooter.SPIRAL_MOTOR_VELOCITY);
if ((globalShooter.getPropelMotorVelocity() >= Constants.constShooter.PROPEL_MOTOR_VELOCITY)
&& (globalShooter.getSpiralMotorVelocity() >= Constants.constShooter.SPIRAL_MOTOR_VELOCITY)) {
globalStager.setStagerMotorVelocity(Constants.constStager.STAGER_MOTOR_VELOCITY);
globalStager.setTopStagerMotorVelocity(Constants.constStager.TOP_STAGER_MOTOR_VELOCITY);
globalLED.setLEDs(constLED.LED_SHOOTING);
} else {
globalStager.setStagerMotorVelocityNuetralOutput();
}
// globalShooter.setPropelMotorVelocity(Constants.constShooter.PROPEL_MOTOR_VELOCITY);
// globalShooter.setSpiralMotorVelocity(Constants.constShooter.SPIRAL_MOTOR_VELOCITY);
// if ((globalShooter.getPropelMotorVelocity() >=
// Constants.constShooter.PROPEL_MOTOR_VELOCITY)
// && (globalShooter.getSpiralMotorVelocity() >=
// Constants.constShooter.SPIRAL_MOTOR_VELOCITY)) {
globalStager.setStagerMotorVelocity(Constants.constStager.STAGER_MOTOR_VELOCITY);
globalStager.setTopStagerMotorVelocity(Constants.constStager.TOP_STAGER_MOTOR_VELOCITY);
globalLED.setLEDs(constLED.LED_SHOOTING);
// } else {
// globalStager.setStagerMotorVelocityNuetralOutput();
// }
}

// Called every time the scheduler runs while the command is scheduled.
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/subsystems/Stager.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ public void setStagerMotorVelocityNuetralOutput() {
}

public boolean getHasGP() {
return hasGP.get();
return !hasGP.get();
}

@Override
public void periodic() {
// This method will be called once per scheduler run
SmartDashboard.putBoolean("hasGP", !getHasGP());
SmartDashboard.putBoolean("hasGP", getHasGP());
}
}

0 comments on commit abcf41a

Please sign in to comment.