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

coded minimum and maximum angles for the angleShooterSubystem #59

Merged
merged 1 commit into from
Feb 13, 2024
Merged
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
2 changes: 2 additions & 0 deletions src/main/java/frc/robot/settings/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@ public static final class ShooterConstants{
public static final double DEGREES_PER_ROTATION = 2491;
public static final double DISTANCE_MULTIPLIER = 0;
public static final double OFFSET_MULTIPLIER = 1;
public static final double MINIMUM_SHOOTER_ANGLE = 10;//still has to be found
public static final double MAXIMUM_SHOOTER_ANGLE = 120;//still has to be found



Expand Down
6 changes: 6 additions & 0 deletions src/main/java/frc/robot/subsystems/AngleShooterSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ public double calculateSpeakerAngleDifference() {
double desiredShooterAngle = Math
.toDegrees(Math.asin(Field.SPEAKER_Z - ShooterConstants.SHOOTER_HEIGHT / totalDistToSpeaker));
desiredShooterAngle = desiredShooterAngle+(speakerDist*DISTANCE_MULTIPLIER);
if(desiredShooterAngle<ShooterConstants.MINIMUM_SHOOTER_ANGLE) {
desiredShooterAngle = ShooterConstants.MINIMUM_SHOOTER_ANGLE;
}
if(desiredShooterAngle>ShooterConstants.MAXIMUM_SHOOTER_ANGLE) {
desiredShooterAngle = ShooterConstants.MAXIMUM_SHOOTER_ANGLE;
}
SmartDashboard.putNumber("desired shooter angle", desiredShooterAngle);

double differenceAngle = (desiredShooterAngle - this.getShooterAngle());
Expand Down
Loading