Skip to content

Commit

Permalink
added arm contingency in case of broken dispenser wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
AvidCoder27 committed Dec 4, 2024
1 parent 94446cd commit ba96c7c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
10 changes: 5 additions & 5 deletions src/main/java/frc/team5115/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ public static class SwerveConstants {
public static class VisionConstants {
public static final String cameraName = "FOV_120_Degrees";
public static final double camYaw = Math.toRadians(+180.0);
public static final double camPitch = Math.toRadians(-37.0);
public static final double camRoll = Math.toRadians(0);
public static final double camZ = +0.57;
public static final double camX = -0.35;
public static final double camY = -0.06;
public static final double camPitch = Math.toRadians(-59.0);
public static final double camRoll = Math.toRadians(+180.0);
public static final double camZ = +0.10;
public static final double camX = +0.19;
public static final double camY = -0.19;
public static final Transform3d robotToCam =
new Transform3d(camX, camY, camZ, new Rotation3d(camRoll, camPitch, camYaw));
}
Expand Down
4 changes: 1 addition & 3 deletions src/main/java/frc/team5115/commands/DriveCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,7 @@ public static Command quickScore(Dispenser dispenser, Arm arm, Drivetrain drivet
arm.prepareDispense(),
arm.waitForSetpoint(3.0),
drivetrain.alignPoseB(),
dispenser.dispense(),
dispenser.waitTillNoCanister(),
dispenser.stop(),
arm.dispenseContingency(),
drivetrain.alignPoseA(),
arm.stow())
.withInterruptBehavior(InterruptionBehavior.kCancelIncoming);
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/frc/team5115/subsystems/arm/Arm.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public enum State {
STOWED(+66.0),
INTAKE(-22.0),
DISPENSE(+135.0),
STACK(+180.0); // TODO add accurate stack position
STACK(+180.0), // TODO add accurate stack position
CONTINGENCY(+150.0); // TODO make sure angle is correct

private final double position;

Expand Down Expand Up @@ -128,6 +129,10 @@ public Command intake() {
return setState(State.INTAKE);
}

public Command dispenseContingency() {
return setState(State.CONTINGENCY);
}

// manipulate arm with joystic
public void goAtVoltage(double speed) {
io.setArmVoltage(speed * maxVolts);
Expand Down

0 comments on commit ba96c7c

Please sign in to comment.