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

Adi storage joint #28

Merged
merged 3 commits into from
Feb 22, 2025
Merged
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
11 changes: 5 additions & 6 deletions src/main/java/frc/robot/subsystems/CoralJoint.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class CoralJoint extends SmartMotorControllerGenericSubsystem {

public enum StoragePose {

INTAKE(-1), L1(-1), L2(-1), L3(-1), RESTING(-1);
INTAKE(-1), PLACEMENT(-1), RESTING(-1);

public final double neededPitch;

Expand All @@ -21,14 +21,13 @@ public enum StoragePose {
}
}

public static final double CORAL_JOINT_FORWARD_SPEED = 0.175;
public static final double CORAL_JOINT_BACKWARD_SPEED = -0.175;
public static final double CORAL_JOINT_FORWARD_SPEED = 0.5;
public static final double CORAL_JOINT_BACKWARD_SPEED = 0.5;

private static final String NAMESPACE_NAME = "coral joint";
private static final double GEAR_RATIO = 1;
private static final double DEGREES_IN_ROTATIONS = 360;
private static final double DISTANCE_PER_PULSE = GEAR_RATIO * DEGREES_IN_ROTATIONS;
private static final double SECONDS_IN_MINUTE = 60;

private final TalonFXWrapper talonFX;
private final DigitalInput topLimit;
Expand Down Expand Up @@ -62,9 +61,9 @@ public boolean canMove(double speed) {

public void calibrateEncoderPosition() {
if (topLimit.get()) {
talonFX.setPosition(STORAGE_POSE.L3.neededPitch);
talonFX.setPosition(StoragePose.RESTING.neededPitch);
} else if (bottomLimit.get()) {
talonFX.setPosition(STORAGE_POSE.RESTING.neededPitch);
talonFX.setPosition(StoragePose.PLACEMENT.neededPitch);
}
}

Expand Down