Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dannynotsmart committed Jan 11, 2025
1 parent aeb3089 commit 6aef85c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 52 deletions.
16 changes: 6 additions & 10 deletions src/main/java/org/sciborgs1155/robot/hopper/Hopper.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,35 @@

public class Hopper extends SubsystemBase implements AutoCloseable {
public static Hopper create() {
// HopperIO hardware = Robot.isReal() ? new RealHopper() : (Robot.isSimulation() ? new
// SimHopper() : new NoHopper());
// return new Hopper(hardware);

return Robot.isReal() ? new Hopper(new RealHopper()) : Hopper.none();
}

public static Hopper none() {
return new Hopper(new NoHopper());
}

private final HopperIO hardware;
private final Trigger beambreakTrigger;
public final HopperIO hardware;
public final Trigger beambreakTrigger;

public Hopper(HopperIO hardware) {
this.hardware = hardware;
this.beambreakTrigger = new Trigger(hardware::beambreak);
}

public Command runHopper(double power) {
public Command run(double power) {
return runOnce(() -> hardware.setPower(power));
}

public Command intake() {
return runHopper(HopperConstants.INTAKE_POWER); // more logic later
return run(HopperConstants.INTAKE_POWER); // more logic later
}

public Command outtake() {
return runHopper(-HopperConstants.INTAKE_POWER);
return run(-HopperConstants.INTAKE_POWER);
}

public Command stop() {
return runHopper(0);
return run(0);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,4 @@

public class HopperConstants {
public static final double INTAKE_POWER = 0.9;

public static final double GEARING = 18.0 / 64.0;
public static final double kV = 0.2;
public static final double kA = 0.7;
}
38 changes: 0 additions & 38 deletions src/main/java/org/sciborgs1155/robot/hopper/SimHopper.java

This file was deleted.

0 comments on commit 6aef85c

Please sign in to comment.