Skip to content

Commit

Permalink
818 testing shoot to amp testing and state machine fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon-Zimmerman committed Apr 12, 2024
1 parent 58c78a4 commit 12712bd
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 19 deletions.
10 changes: 5 additions & 5 deletions src/main/java/frc/robot/BuildConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ public final class BuildConstants {
public static final String MAVEN_GROUP = "";
public static final String MAVEN_NAME = "2024RobotCode";
public static final String VERSION = "unspecified";
public static final int GIT_REVISION = 247;
public static final String GIT_SHA = "fb9503c89529ab8398a17bd2d2be09e5575edaf7";
public static final String GIT_DATE = "2024-04-11 22:36:31 EDT";
public static final int GIT_REVISION = 248;
public static final String GIT_SHA = "58c78a4b6feeb04b1f5c4de3013888cb1b1e1b67";
public static final String GIT_DATE = "2024-04-12 01:07:35 EDT";
public static final String GIT_BRANCH = "main";
public static final String BUILD_DATE = "2024-04-12 01:06:08 EDT";
public static final long BUILD_UNIX_TIME = 1712898368415L;
public static final String BUILD_DATE = "2024-04-12 19:20:47 EDT";
public static final long BUILD_UNIX_TIME = 1712964047399L;
public static final int DIRTY = 1;

private BuildConstants() {}
Expand Down
9 changes: 5 additions & 4 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -348,18 +348,18 @@ public RobotContainer() {
new SelectCommand<>(
Map.ofEntries(
Map.entry(
TRAP_STATES.NONE,
TRAP_STATES.PIVOT,
new SetPivotTarget(Constants.PivotConstants.TRAP_SETPOINT_DEG, pivot)
.andThen(trapStateMachine::advanceTargetState, elevator)),
Map.entry(
TRAP_STATES.PIVOT,
TRAP_STATES.EXTEND,
new SetElevatorTarget(
Constants.ElevatorConstants.EXTEND_SETPOINT_INCH, 1.5, elevator)
.andThen(new InstantCommand(() -> pivot.setShootState(SHOOT_STATE.TRAP)))
.andThen(trapStateMachine::advanceTargetState, elevator)),
Map.entry(
TRAP_STATES.RETRACT_STOW,
new SetElevatorTarget(0, 0.5, elevator)
new SetElevatorTarget(0, 1.5, elevator)
.andThen(
new SetPivotTarget(Constants.PivotConstants.STOW_SETPOINT_DEG, pivot))
.andThen(new InstantCommand(() -> pivot.setShootState(SHOOT_STATE.AIMBOT)))
Expand Down Expand Up @@ -719,7 +719,8 @@ private void driverControls() {
new InstantCommand(() -> shooter.stopFeeders(), shooter)
.andThen(
new InstantCommand(shooter::stopFlywheels)
.andThen(new InstantCommand(() -> led.setState(LED_STATE.BLUE)))));
.andThen(new InstantCommand(() -> led.setState(LED_STATE.BLUE))))
.andThen(new InstantCommand(() -> shooter.turnOffFan(), shooter)));

driveController.a().onTrue(climbCommands);

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/frc/robot/RobotMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ public static class ShooterIDs {
public static class ElevatorIDs {
// public static final int LEFT = 8;
// public static final int RIGHT = 9;
public static final int LEFT = 102;
public static final int RIGHT = 35;
public static final int LEFT = 8;
public static final int RIGHT = 9;
}

public static class PivotIDs {
public static final int GYRO = 10;
// public static final int LEFT = 14;
// public static final int RIGHT = 15;
public static final int LEFT = 10000;
public static final int RIGHT = 99999;
public static final int LEFT = 14;
public static final int RIGHT = 15;
}

public static class LEDIDs {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/commands/TurnToAmpCorner.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public TurnToAmpCorner(

switch (Constants.currentMode) {
case REAL:
gains[0] = 7;
gains[0] = 4;
gains[1] = 0;
gains[2] = 0;
break;
Expand Down Expand Up @@ -71,7 +71,7 @@ public TurnToAmpCorner(
@Override
public void initialize() {
pivot.setPivotGoal(45);
shooter.setFlywheelRPMs(5800, 5800);
shooter.setFlywheelRPMs(5200, 4900);
}

// Called every time the scheduler runs while the command is scheduled.
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/frc/robot/statemachines/ClimbStateMachine.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ public CLIMB_STATES getTargetState() {
public void advanceTargetState() {
switch (targetState) {
case NONE:
targetState = CLIMB_STATES.PIVOT;
break;
case PIVOT:
targetState = CLIMB_STATES.EXTEND;
break;
// case PIVOT:
// targetState = CLIMB_STATES.EXTEND;
// break;
case EXTEND:
targetState = CLIMB_STATES.RETRACT;
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public enum TRAP_STATES {
RETRACT_STOW
}

private TRAP_STATES targetState = TRAP_STATES.NONE;
private TRAP_STATES targetState = TRAP_STATES.PIVOT;

public TRAP_STATES getTargetState() {
return targetState;
Expand Down

0 comments on commit 12712bd

Please sign in to comment.