mirror of
https://github.com/Team4388/2026KPopRobotHunters.git
synced 2026-06-08 16:28:05 -06:00
Encoder Fix code to test
This commit is contained in:
@@ -167,7 +167,7 @@ public class RobotContainer {
|
|||||||
IntakeRetracted,
|
IntakeRetracted,
|
||||||
new WaitCommand(4.4),
|
new WaitCommand(4.4),
|
||||||
new InstantCommand(() -> m_robotShooter.denyShooting(), m_robotShooter),
|
new InstantCommand(() -> m_robotShooter.denyShooting(), m_robotShooter),
|
||||||
new InstantCommand(()->m_robotShooter.spinUpIdle(), m_robotShooter)
|
new InstantCommand(()-> m_robotShooter.spinUpIdle(), m_robotShooter)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@@ -382,6 +382,11 @@ public class RobotContainer {
|
|||||||
m_robotIntake.setMode(IntakeMode.ExtendingRolling);
|
m_robotIntake.setMode(IntakeMode.ExtendingRolling);
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
new JoystickButton(getDeadbandedOperatorController(), XboxController.BACK_BUTTON)
|
||||||
|
.onTrue(new InstantCommand(() -> {
|
||||||
|
m_robotIntake.setMode(IntakeMode.EncoderFix);
|
||||||
|
}));
|
||||||
|
|
||||||
new JoystickButton(getDeadbandedOperatorController(), XboxController.B_BUTTON)
|
new JoystickButton(getDeadbandedOperatorController(), XboxController.B_BUTTON)
|
||||||
.onTrue(new InstantCommand(() -> {
|
.onTrue(new InstantCommand(() -> {
|
||||||
m_robotIntake.setMode(IntakeMode.LabubuGrowl);
|
m_robotIntake.setMode(IntakeMode.LabubuGrowl);
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ public class Intake extends SubsystemBase {
|
|||||||
ExtendingIdle,
|
ExtendingIdle,
|
||||||
ExtendingRolling,
|
ExtendingRolling,
|
||||||
|
|
||||||
|
EncoderFix,
|
||||||
Retracting,
|
Retracting,
|
||||||
ArmIdleRollingNot,
|
ArmIdleRollingNot,
|
||||||
|
|
||||||
@@ -122,12 +123,18 @@ public class Intake extends SubsystemBase {
|
|||||||
io.armOutput(IntakeConstants.ARM_EXTEND_PERCENT_OUTPUT.get());
|
io.armOutput(IntakeConstants.ARM_EXTEND_PERCENT_OUTPUT.get());
|
||||||
io.setRollerOutput(state, 0);
|
io.setRollerOutput(state, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case ExtendingRolling:
|
case ExtendingRolling:
|
||||||
io.armOutput(IntakeConstants.ARM_EXTEND_PERCENT_OUTPUT.get());
|
io.armOutput(IntakeConstants.ARM_EXTEND_PERCENT_OUTPUT.get());
|
||||||
io.setRollerOutput(state, IntakeConstants.ROLLER_PERCENT_OUTPUT.get()); //getTargetRollerSpeed(ChassisOverallSpeed));
|
io.setRollerOutput(state, IntakeConstants.ROLLER_PERCENT_OUTPUT.get()); //getTargetRollerSpeed(ChassisOverallSpeed));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case EncoderFix:
|
||||||
|
io.armFix(IntakeConstants.FIX_ARM_PERCENT_OUTPUT.get());
|
||||||
|
io.setRollerOutput(state, 0);
|
||||||
|
break;
|
||||||
|
|
||||||
case Retracting:
|
case Retracting:
|
||||||
io.armOutput(IntakeConstants.ARM_RETRACT_PERCENT_OUTPUT.get());
|
io.armOutput(IntakeConstants.ARM_RETRACT_PERCENT_OUTPUT.get());
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public class IntakeConstants {
|
|||||||
// public static final ConfigurableDouble INTAKE_SQUEEZE_CURRENT_UPPER_THRESHOLD = new ConfigurableDouble("Intake Squeeze Current UPPER THRESHOLD", 25);
|
// public static final ConfigurableDouble INTAKE_SQUEEZE_CURRENT_UPPER_THRESHOLD = new ConfigurableDouble("Intake Squeeze Current UPPER THRESHOLD", 25);
|
||||||
public static final ConfigurableDouble ARM_SQUEEZE_PERCENT_OUTPUT = new ConfigurableDouble("Arm squeeze % output", -0.2);
|
public static final ConfigurableDouble ARM_SQUEEZE_PERCENT_OUTPUT = new ConfigurableDouble("Arm squeeze % output", -0.2);
|
||||||
public static final ConfigurableDouble ARM_REDUCED_SQUEEZE_PERCENT_OUTPUT = new ConfigurableDouble("Arm reduce squeeze % output", 0.02);
|
public static final ConfigurableDouble ARM_REDUCED_SQUEEZE_PERCENT_OUTPUT = new ConfigurableDouble("Arm reduce squeeze % output", 0.02);
|
||||||
|
public static final ConfigurableDouble FIX_ARM_PERCENT_OUTPUT = new ConfigurableDouble("Arm encoder fix % output", -0.1);
|
||||||
|
|
||||||
//IDs
|
//IDs
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ public interface IntakeIO {
|
|||||||
public default void stopArm() {}
|
public default void stopArm() {}
|
||||||
public default void setRollerOutput(IntakeState state, double rollerOutput) {}
|
public default void setRollerOutput(IntakeState state, double rollerOutput) {}
|
||||||
public default void armOutput(double percentOutput) {}
|
public default void armOutput(double percentOutput) {}
|
||||||
|
public default void armFix(double percentOutput) {}
|
||||||
public default void updateInputs(IntakeState state) {}
|
public default void updateInputs(IntakeState state) {}
|
||||||
public default void updateGains() {}
|
public default void updateGains() {}
|
||||||
}
|
}
|
||||||
@@ -111,6 +111,11 @@ public class IntakeReal implements IntakeIO {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void armFix(double percentOutput) {
|
||||||
|
m_armMotor.set(percentOutput);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateInputs(IntakeState state) {
|
public void updateInputs(IntakeState state) {
|
||||||
m_encoder.update();
|
m_encoder.update();
|
||||||
|
|||||||
Reference in New Issue
Block a user