From a6eab2e70c3867d252574d333d9f97f29a921a46 Mon Sep 17 00:00:00 2001 From: driverstation1 <5026craptop@gmail.com> Date: Tue, 28 Nov 2023 18:03:53 -0800 Subject: [PATCH] Bug Fix --- .../frc/robot/Commands/AdvancedIntakeSequence.java | 13 +++++++++---- src/main/java/frc/robot/Commands/IntakeCommand.java | 2 +- src/main/java/frc/robot/RobotContainer.java | 3 --- .../java/frc/robot/Subsystems/IntakeSubsystem.java | 4 ++-- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/main/java/frc/robot/Commands/AdvancedIntakeSequence.java b/src/main/java/frc/robot/Commands/AdvancedIntakeSequence.java index e2c45f5..811040d 100644 --- a/src/main/java/frc/robot/Commands/AdvancedIntakeSequence.java +++ b/src/main/java/frc/robot/Commands/AdvancedIntakeSequence.java @@ -16,10 +16,15 @@ public class AdvancedIntakeSequence extends SequentialCommandGroup { public AdvancedIntakeSequence(IntakeSubsystem intakeSubsystem, boolean isCone, boolean isIntake) { // Add your commands in the addCommands() call, e.g. // addCommands(new FooCommand(), new BarCommand()); - if(isIntake){ - addCommands( new IntakeCommand(intakeSubsystem, isCone, isIntake), new StopIntakeMotorCommand(intakeSubsystem)); - }else{ - addCommands( new IntakeCommand(intakeSubsystem, isCone, isIntake).withTimeout(Constants.Intake.UNLOADING_WAIT_TIME), new StopIntakeMotorCommand(intakeSubsystem) ); + if (isIntake) { + addCommands( + new IntakeCommand(intakeSubsystem, isCone, isIntake), + new StopIntakeMotorCommand(intakeSubsystem)); + } else { + addCommands( + new IntakeCommand(intakeSubsystem, isCone, isIntake) + .withTimeout(Constants.Intake.UNLOADING_WAIT_TIME), + new StopIntakeMotorCommand(intakeSubsystem)); } } } diff --git a/src/main/java/frc/robot/Commands/IntakeCommand.java b/src/main/java/frc/robot/Commands/IntakeCommand.java index 491721f..418abc7 100644 --- a/src/main/java/frc/robot/Commands/IntakeCommand.java +++ b/src/main/java/frc/robot/Commands/IntakeCommand.java @@ -37,7 +37,7 @@ public void initialize() { intakeSubsystem.SetMotorPower(Constants.Intake.CUBE_UNLOADING_SPEED); } - //set the object type - used in the stoter currents + // set the object type - used in the stoter currents intakeSubsystem.SetObjectType(isCone); } diff --git a/src/main/java/frc/robot/RobotContainer.java b/src/main/java/frc/robot/RobotContainer.java index 1af7d2d..44f9ede 100644 --- a/src/main/java/frc/robot/RobotContainer.java +++ b/src/main/java/frc/robot/RobotContainer.java @@ -7,8 +7,6 @@ import edu.wpi.first.wpilibj.XboxController; import edu.wpi.first.wpilibj2.command.button.CommandXboxController; import frc.robot.Commands.AdvancedIntakeSequence; -import frc.robot.Commands.IntakeCommand; -import frc.robot.Commands.StopIntakeMotorCommand; import frc.robot.Subsystems.IntakeSubsystem; /** @@ -68,6 +66,5 @@ private void configureButtonBindings() { driverB.leftTrigger().onTrue(new AdvancedIntakeSequence(intakeSubsystem, true, true)); driverB.rightBumper().onTrue(new AdvancedIntakeSequence(intakeSubsystem, false, false)); driverB.leftBumper().onTrue(new AdvancedIntakeSequence(intakeSubsystem, true, false)); - } } diff --git a/src/main/java/frc/robot/Subsystems/IntakeSubsystem.java b/src/main/java/frc/robot/Subsystems/IntakeSubsystem.java index 67a5097..75c618e 100644 --- a/src/main/java/frc/robot/Subsystems/IntakeSubsystem.java +++ b/src/main/java/frc/robot/Subsystems/IntakeSubsystem.java @@ -53,8 +53,8 @@ public void SetMotorPower(double motorPower) { this.motorPower = motorPower; } - //to set the object as either a cone or a cube - //to be called in commands alongside of set motor power + // to set the object as either a cone or a cube + // to be called in commands alongside of set motor power public void SetObjectType(boolean isCone) { this.isCone = isCone; }