Skip to content

Commit

Permalink
shoot commands
Browse files Browse the repository at this point in the history
  • Loading branch information
davidchen20 committed Apr 11, 2024
1 parent 5ce2f3b commit 297b1ed
Show file tree
Hide file tree
Showing 9 changed files with 738 additions and 834 deletions.
12 changes: 6 additions & 6 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 = 232;
public static final String GIT_SHA = "6834ac1440a7b21915ba95c3c11ed8062bf92410";
public static final String GIT_DATE = "2024-04-10 20:52:01 EDT";
public static final String GIT_BRANCH = "Intake-fix";
public static final String BUILD_DATE = "2024-04-10 22:19:42 EDT";
public static final long BUILD_UNIX_TIME = 1712801982930L;
public static final int GIT_REVISION = 244;
public static final String GIT_SHA = "5ce2f3b8f1d5483a507c5cbc20b92d4f61692594";
public static final String GIT_DATE = "2024-04-11 16:44:34 EDT";
public static final String GIT_BRANCH = "main";
public static final String BUILD_DATE = "2024-04-11 17:48:27 EDT";
public static final long BUILD_UNIX_TIME = 1712872107510L;
public static final int DIRTY = 1;

private BuildConstants() {}
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,4 +162,11 @@ public static enum LED_STATE {
FIRE,
OFF
}

public static enum SHOOT_STATE {
PIVOT_PRESET,
AIMBOT,
AMP,
TRAP
}
}
1,413 changes: 708 additions & 705 deletions src/main/java/frc/robot/RobotContainer.java

Large diffs are not rendered by default.

42 changes: 0 additions & 42 deletions src/main/java/frc/robot/commands/FollowPath.java

This file was deleted.

46 changes: 0 additions & 46 deletions src/main/java/frc/robot/commands/InFeederLEDCheck.java

This file was deleted.

3 changes: 2 additions & 1 deletion src/main/java/frc/robot/commands/IntakeNote.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public void initialize() {
// Called every time the scheduler runs while the command is scheduled.
@Override
public void execute() {
if (shooter.seesNote() == NoteState.CURRENT || shooter.seesNote() == NoteState.SENSOR) end(true);
if (shooter.seesNote() == NoteState.CURRENT || shooter.seesNote() == NoteState.SENSOR)
end(true);
}

// Called once the command ends or is interrupted.
Expand Down
28 changes: 0 additions & 28 deletions src/main/java/frc/robot/commands/PivotClimb.java

This file was deleted.

9 changes: 3 additions & 6 deletions src/main/java/frc/robot/subsystems/Shooter/Shooter.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import edu.wpi.first.math.controller.SimpleMotorFeedforward;
import edu.wpi.first.wpilibj.DriverStation;
import edu.wpi.first.wpilibj.DriverStation.Alliance;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.Constants;
import frc.robot.Constants.NoteState;
Expand All @@ -23,8 +22,6 @@ public class Shooter extends SubsystemBase {
private DistanceSensorIO dist;
private NoteState lastNoteState;

private double lastSeenNoteTime = 0;

private final FlywheelIOInputsAutoLogged flyInputs = new FlywheelIOInputsAutoLogged();
private final FeederIOInputsAutoLogged feedInputs = new FeederIOInputsAutoLogged();
private final DistanceSensorIOInputsAutoLogged sInputs = new DistanceSensorIOInputsAutoLogged();
Expand Down Expand Up @@ -130,13 +127,13 @@ public void setFlywheelRPMSAmp() {
}

public double[] getFlywheelVelocitiesRPM() {
return new double[] { flyInputs.leftVelocityRPM, flyInputs.leftVelocityRPM };
return new double[] {flyInputs.leftVelocityRPM, flyInputs.leftVelocityRPM};
}

public double[] getFlywheelErrors() {
return new double[] {
flyInputs.leftVelocitySetpointRPM - getFlywheelVelocitiesRPM()[0],
flyInputs.rightVelocitySetpointRPM - getFlywheelVelocitiesRPM()[1]
flyInputs.leftVelocitySetpointRPM - getFlywheelVelocitiesRPM()[0],
flyInputs.rightVelocitySetpointRPM - getFlywheelVelocitiesRPM()[1]
};
}

Expand Down
12 changes: 12 additions & 0 deletions src/main/java/frc/robot/subsystems/pivot/Pivot.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import edu.wpi.first.math.trajectory.TrapezoidProfile;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.Constants;
import frc.robot.Constants.SHOOT_STATE;
import org.littletonrobotics.junction.Logger;

public class Pivot extends SubsystemBase {
Expand All @@ -34,6 +35,7 @@ public class Pivot extends SubsystemBase {
double goal;

boolean isAimbot;
SHOOT_STATE shootState;

private ArmFeedforward pivotFFModel;

Expand Down Expand Up @@ -66,6 +68,8 @@ public Pivot(PivotIO pivot) {

isAimbot = true;

shootState = SHOOT_STATE.AIMBOT;

maxVelocityDegPerSec = 150;
maxAccelerationDegPerSecSquared = 226;
// maxAccelerationDegPerSecSquared = 180;
Expand Down Expand Up @@ -126,6 +130,14 @@ public boolean isAimbot() {
return isAimbot;
}

public SHOOT_STATE getShootState() {
return shootState;
}

public void setShootState(SHOOT_STATE shootState) {
this.shootState = shootState;
}

public void setAimbot(boolean isAimbot) {
this.isAimbot = isAimbot;
}
Expand Down

0 comments on commit 297b1ed

Please sign in to comment.