From bbb53c7ae92bbe44ed3e8acbed43b07b0a2856f6 Mon Sep 17 00:00:00 2001 From: FRCTeam3255-Shared <170778697+FRCTeam3255-Shared-K1-10@users.noreply.github.com> Date: Sat, 30 May 2026 14:42:21 -0700 Subject: [PATCH 1/4] added requirments for state machine Co-Authored-By: jayden mendoza <244560677+jaymendo670-png@users.noreply.github.com> --- src/main/java/frc/robot/commands/states/Intaking.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/frc/robot/commands/states/Intaking.java b/src/main/java/frc/robot/commands/states/Intaking.java index 02bdcdf..d20483e 100644 --- a/src/main/java/frc/robot/commands/states/Intaking.java +++ b/src/main/java/frc/robot/commands/states/Intaking.java @@ -12,6 +12,7 @@ public class Intaking extends Command { /** Creates a new Intaking. */ public Intaking() { + addRequirements(RobotContainer.stateMachineInstance); } // Called when the command is initially scheduled. From 3742080e16fc74d566ed2ebe74ecbff72f1e9bc4 Mon Sep 17 00:00:00 2001 From: FRCTeam3255-Shared <170778697+FRCTeam3255-Shared-K1-10@users.noreply.github.com> Date: Sat, 30 May 2026 14:48:54 -0700 Subject: [PATCH 2/4] intaking logic Co-Authored-By: jayden mendoza <244560677+jaymendo670-png@users.noreply.github.com> --- src/main/java/frc/robot/commands/states/Intaking.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/frc/robot/commands/states/Intaking.java b/src/main/java/frc/robot/commands/states/Intaking.java index d20483e..cda3a5e 100644 --- a/src/main/java/frc/robot/commands/states/Intaking.java +++ b/src/main/java/frc/robot/commands/states/Intaking.java @@ -8,6 +8,7 @@ import frc.robot.RobotContainer; import frc.robot.constants.ConstMotion; import frc.robot.constants.ConstRotors; +import frc.robot.subsystems.StateMachine; public class Intaking extends Command { /** Creates a new Intaking. */ @@ -18,6 +19,7 @@ public Intaking() { // Called when the command is initially scheduled. @Override public void initialize() { + RobotContainer.stateMachineInstance.setRobotState(StateMachine.RobotState.INTAKING); RobotContainer.motionInstance.setIntakePivotAngle(ConstMotion.INTAKE_PIVOT_DEPLOY); } From 8b2d253fc1fa5088c70df368fd76e8f2820bc4b3 Mon Sep 17 00:00:00 2001 From: FRCTeam3255-Shared <170778697+FRCTeam3255-Shared-K1-10@users.noreply.github.com> Date: Sat, 30 May 2026 16:03:15 -0700 Subject: [PATCH 3/4] intake logic fixes Co-Authored-By: jayden mendoza <244560677+jaymendo670-png@users.noreply.github.com> --- src/main/java/frc/robot/commands/states/Intaking.java | 6 +++--- .../java/frc/robot/commands/states/RetractIntake.java | 2 +- src/main/java/frc/robot/constants/ConstMotion.java | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/main/java/frc/robot/commands/states/Intaking.java b/src/main/java/frc/robot/commands/states/Intaking.java index cda3a5e..24544de 100644 --- a/src/main/java/frc/robot/commands/states/Intaking.java +++ b/src/main/java/frc/robot/commands/states/Intaking.java @@ -19,15 +19,15 @@ public Intaking() { // Called when the command is initially scheduled. @Override public void initialize() { + RobotContainer.motionInstance.setIntakePivotAngle(ConstMotion.DEPLOY_INTAKE_PIVOT_ANGLE); + RobotContainer.rotorsInstance.setIntakeRollersPercentOutput(ConstRotors.INTAKE_ROLLERS_SPEED); RobotContainer.stateMachineInstance.setRobotState(StateMachine.RobotState.INTAKING); - RobotContainer.motionInstance.setIntakePivotAngle(ConstMotion.INTAKE_PIVOT_DEPLOY); + } // Called every time the scheduler runs while the command is scheduled. @Override public void execute() { - RobotContainer.rotorsInstance.setIntakeRollersPercentOutput(ConstRotors.INTAKE_ROLLERS_SPEED); - } // Called once the command ends or is interrupted. diff --git a/src/main/java/frc/robot/commands/states/RetractIntake.java b/src/main/java/frc/robot/commands/states/RetractIntake.java index 13e9907..8779438 100644 --- a/src/main/java/frc/robot/commands/states/RetractIntake.java +++ b/src/main/java/frc/robot/commands/states/RetractIntake.java @@ -17,7 +17,7 @@ public RetractIntake() { // Called when the command is initially scheduled. @Override public void initialize() { - RobotContainer.motionInstance.setIntakePivotAngle(ConstMotion.INTAKE_PIVOT_RETRACT); + RobotContainer.motionInstance.setIntakePivotAngle(ConstMotion.RETRACT_INTAKE_PIVOT_ANGLE); } // Called every time the scheduler runs while the command is scheduled. diff --git a/src/main/java/frc/robot/constants/ConstMotion.java b/src/main/java/frc/robot/constants/ConstMotion.java index 0e5a5a0..878021d 100644 --- a/src/main/java/frc/robot/constants/ConstMotion.java +++ b/src/main/java/frc/robot/constants/ConstMotion.java @@ -20,8 +20,8 @@ public class ConstMotion { public static final TalonFXConfiguration INTAKE_PIVOT_CONFIGURATION = new TalonFXConfiguration(); public static final TalonFXConfiguration HOOD_PIVOT_CONFIGURATION = new TalonFXConfiguration(); - public static final Angle INTAKE_PIVOT_DEPLOY = Degrees.of(125); - public static final Angle INTAKE_PIVOT_RETRACT = Degrees.of(0); + public static final Angle DEPLOY_INTAKE_PIVOT_ANGLE = Degrees.of(125); + public static final Angle RETRACT_INTAKE_PIVOT_ANGLE = Degrees.of(0); public static final Angle HOOD_PIVOT_ANGLE = Degrees.of(14); public static final double STOP = 0; @@ -31,8 +31,8 @@ public class ConstMotion { INTAKE_PIVOT_CONFIGURATION.MotorOutput.Inverted = InvertedValue.Clockwise_Positive; INTAKE_PIVOT_CONFIGURATION.SoftwareLimitSwitch.ReverseSoftLimitEnable = true; INTAKE_PIVOT_CONFIGURATION.SoftwareLimitSwitch.ForwardSoftLimitEnable = true; - INTAKE_PIVOT_CONFIGURATION.SoftwareLimitSwitch.ForwardSoftLimitThreshold = INTAKE_PIVOT_DEPLOY.in(Rotations); - INTAKE_PIVOT_CONFIGURATION.SoftwareLimitSwitch.ReverseSoftLimitThreshold = INTAKE_PIVOT_RETRACT.in(Rotations); + INTAKE_PIVOT_CONFIGURATION.SoftwareLimitSwitch.ForwardSoftLimitThreshold = DEPLOY_INTAKE_PIVOT_ANGLE.in(Rotations); + INTAKE_PIVOT_CONFIGURATION.SoftwareLimitSwitch.ReverseSoftLimitThreshold = RETRACT_INTAKE_PIVOT_ANGLE.in(Rotations); INTAKE_PIVOT_CONFIGURATION.Slot0.GravityType = GravityTypeValue.Arm_Cosine; INTAKE_PIVOT_CONFIGURATION.Slot0.kS = 0.3; INTAKE_PIVOT_CONFIGURATION.Slot0.kP = 40; From f658df1e25fe72c4a094a9a3a144f870d7cd25ab Mon Sep 17 00:00:00 2001 From: FRCTeam3255-Shared <170778697+FRCTeam3255-Shared-K1-10@users.noreply.github.com> Date: Sat, 30 May 2026 17:16:33 -0700 Subject: [PATCH 4/4] retract intake state Co-Authored-By: jayden mendoza <244560677+jaymendo670-png@users.noreply.github.com> --- src/main/java/frc/robot/commands/states/RetractIntake.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/frc/robot/commands/states/RetractIntake.java b/src/main/java/frc/robot/commands/states/RetractIntake.java index 599d1f0..c17e3e0 100644 --- a/src/main/java/frc/robot/commands/states/RetractIntake.java +++ b/src/main/java/frc/robot/commands/states/RetractIntake.java @@ -7,6 +7,8 @@ import edu.wpi.first.wpilibj2.command.Command; import frc.robot.RobotContainer; import frc.robot.constants.ConstMotion; +import frc.robot.constants.ConstRotors; +import frc.robot.subsystems.StateMachine; public class RetractIntake extends Command { /** Creates a new RetractIntake. */ @@ -18,7 +20,9 @@ public RetractIntake() { // Called when the command is initially scheduled. @Override public void initialize() { + RobotContainer.rotorsInstance.setIntakeRollersPercentOutput(ConstRotors.STOP); RobotContainer.motionInstance.setIntakePivotAngle(ConstMotion.RETRACT_INTAKE_PIVOT_ANGLE); + RobotContainer.stateMachineInstance.setRobotState(StateMachine.RobotState.RETRACT_INTAKE); } // Called every time the scheduler runs while the command is scheduled.