Skip to content

Commit

Permalink
made constant for amp tolerance
Browse files Browse the repository at this point in the history
  • Loading branch information
ProgrammingSR committed Apr 4, 2024
1 parent 4355d98 commit abe456f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ public static final class IntakeConstants {
// In degrees
public static final double kIntakeLoweredAngle = -193;
public static final double kIntakeRaisedAngle = 0;
public static final double kIntakeAmpScoringAngle = -71; // 193 - 100 (previous angle)
public static final double kIntakeAmpScoringAngle = -71;
public static final int kIntakeAmpTolerance = 2;

/** Encoder offset in rotations */
public static final double kArmEncoderOffset = 0.715;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/subsystems/IntakeSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public double getArmPosition() {
}

public boolean ampReady(){
return m_armEncoder.getDistance() < IntakeConstants.kIntakeAmpScoringAngle + 2 && m_armEncoder.getDistance() > IntakeConstants.kIntakeAmpScoringAngle - 2;
return m_armEncoder.getDistance() < IntakeConstants.kIntakeAmpScoringAngle + IntakeConstants.kIntakeAmpTolerance && m_armEncoder.getDistance() > IntakeConstants.kIntakeAmpScoringAngle - IntakeConstants.kIntakeAmpTolerance;
}

public boolean armAtSetpoint() {
Expand Down

0 comments on commit abe456f

Please sign in to comment.