Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
Co-Authored-By: Sidney Trzepacz <74916637+Sid220@users.noreply.github.com>
  • Loading branch information
RHR2713 and Sid220 committed Feb 10, 2024
1 parent ec47693 commit f66acb6
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 33 deletions.
7 changes: 2 additions & 5 deletions src/main/java/frc/robot/Robot.java
Original file line number Diff line number Diff line change
Expand Up @@ -269,9 +269,7 @@ public void robotInit() {

driver
.a()
.onTrue(
Commands.sequence(
Feeder.Commands.setMotionMode(Feeder.MotionMode.INTAKE_GP)));
.onTrue(Commands.sequence(Feeder.Commands.setMotionMode(Feeder.MotionMode.INTAKE_GP)));
driver.a().onFalse(Commands.sequence(Shooter.Commands.setMotionMode(Shooter.MotionMode.OFF)));

driver
Expand Down Expand Up @@ -302,8 +300,7 @@ public void robotInit() {
new SequentialCommandGroup(
ShooterPivot.Commands.setTargetAndWait(20),
Elevator.Commands.setToHeightAndWait(20)));



// operator.a().whileTrue(autoCommand)

// shooterPivot.setGoal(10);
Expand Down
30 changes: 10 additions & 20 deletions src/main/java/frc/robot/subsystems/feederIO/Feeder.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,19 @@
import frc.robot.util.LoggableMotor;
import lombok.Getter;
import lombok.Setter;

import org.littletonrobotics.junction.Logger;




public class Feeder extends SubsystemBase {
@Getter private LoggableMotor feederMotor;

public enum MotionMode
{
public enum MotionMode {
INTAKE_GP,
HOLD_GAMEPIECE,
SEND_TO_SHOOTER,
OFF;
}


@Setter
public MotionMode motionMode = MotionMode.OFF;
@Setter public MotionMode motionMode = MotionMode.OFF;
private FeederIO IO;
private double target;
private FeederInputsAutoLogged inputs;
Expand All @@ -55,30 +48,27 @@ public void periodic() {
switch (motionMode) {
case INTAKE_GP:
setTarget(2000);
if(hasGamepiece())
{
if (hasGamepiece()) {
motionMode = MotionMode.HOLD_GAMEPIECE;
}
break;
break;
case HOLD_GAMEPIECE:
setTarget(0);
break;
case SEND_TO_SHOOTER:
break;
case SEND_TO_SHOOTER:
setTarget(2000);
if(!hasGamepiece())
{
if (!hasGamepiece()) {
motionMode = MotionMode.OFF;
}
break;
break;
case OFF:
default:
default:
setTarget(0);
break;
}
}

public boolean hasGamepiece()
{
public boolean hasGamepiece() {
return IO.hasGamepiece();
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/subsystems/feederIO/FeederIO.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ public static class FeederInputs {

public void updateInputs(FeederInputsAutoLogged inputs);

public boolean hasGamepiece();
public boolean hasGamepiece();
}
3 changes: 1 addition & 2 deletions src/main/java/frc/robot/subsystems/feederIO/FeederIOSim.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ public void setSetpoint(double setpointRPM) {
}

@Override
public boolean hasGamepiece()
{
public boolean hasGamepiece() {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class FeederIOSparks implements FeederIO {
CANSparkMax motor;
double setpoint = 0;
private TimeOfFlight sensor;

public FeederIOSparks() {
motor = new CANSparkMax(RobotMap.FEEDER_CAN_ID, MotorType.kBrushless);
motor.getPIDController().setP(FeederConstants.FEEDER_GAINS.getKP());
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/frc/robot/subsystems/intakeIO/Intake.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
import edu.wpi.first.wpilibj2.command.WaitUntilCommand;
import frc.robot.Constants;
import frc.robot.Robot;
import frc.robot.subsystems.feederIO.Feeder;
import frc.robot.subsystems.feederIO.Feeder.FeederState;
import frc.robot.util.LoggableMotor;
import frc.robot.util.RumbleManager;
import lombok.Setter;
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/frc/robot/subsystems/intakeIO/IntakeIOSim.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import edu.wpi.first.math.MathUtil;
import edu.wpi.first.math.system.plant.DCMotor;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.simulation.DCMotorSim;
import frc.robot.Constants;

Expand All @@ -22,8 +21,7 @@ public class IntakeIOSim implements IntakeIO {

private double rightVolts;

public IntakeIOSim() {
}
public IntakeIOSim() {}

@Override
public void setCurrentLimit(int currentLimit) {
Expand Down

0 comments on commit f66acb6

Please sign in to comment.