Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amp led fix #42

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 + 1) || (m_armEncoder.getDistance() > IntakeConstants.kIntakeAmpScoringAngle - 1));
return m_armEncoder.getDistance() < (IntakeConstants.kIntakeAmpScoringAngle + IntakeConstants.kIntakeAmpTolerance) && m_armEncoder.getDistance() > (IntakeConstants.kIntakeAmpScoringAngle - IntakeConstants.kIntakeAmpTolerance);
}

public boolean armAtSetpoint() {
Expand Down
Loading