Make the new manual operator controlls

This commit is contained in:
C4llSiqn
2025-02-27 19:47:21 -07:00
parent 1b90bc8289
commit f0565d7844
3 changed files with 160 additions and 199 deletions
@@ -6,6 +6,8 @@ package frc4388.robot.subsystems;
import java.time.Instant;
import org.opencv.ml.RTrees;
import com.ctre.phoenix6.configs.Slot0Configs;
import com.ctre.phoenix6.controls.PositionDutyCycle;
import com.ctre.phoenix6.controls.PositionVoltage;
@@ -40,6 +42,8 @@ public class Elevator extends SubsystemBase {
private boolean elevatorManualStop = true;
private boolean endefectorManualStop = true;
private boolean disableAutoIntake = false;
private DigitalInput basinBeamBreak;
private DigitalInput endeffectorLimitSwitch;
@@ -197,6 +201,10 @@ public class Elevator extends SubsystemBase {
}
public void togggleAutoIntaking() {
disableAutoIntake = !disableAutoIntake;
}
public boolean elevatorAtReference() {
// double elevatorRefrence = elevatorMotor.getClosedLoopReference().getValueAsDouble();
double elevatorPosition = elevatorMotor.getPosition().getValueAsDouble();
@@ -272,6 +280,8 @@ public class Elevator extends SubsystemBase {
SmartDashboard.putNumber("Basin", basinBeamBreak.get() ? 1 : 0);
SmartDashboard.putNumber("endefector", endeffectorLimitSwitch.get() ? 1 : 0);
SmartDashboard.putString("State", currentState.toString());
if (disableAutoIntake) return;
if (currentState == CoordinationState.Waiting) {
periodicWaiting();