Skip to content

Commit

Permalink
Bug Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Craptop committed Nov 29, 2023
1 parent 1469066 commit a6eab2e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
13 changes: 9 additions & 4 deletions src/main/java/frc/robot/Commands/AdvancedIntakeSequence.java
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
}
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/Commands/IntakeCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
3 changes: 0 additions & 3 deletions src/main/java/frc/robot/RobotContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -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));

}
}
4 changes: 2 additions & 2 deletions src/main/java/frc/robot/Subsystems/IntakeSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit a6eab2e

Please sign in to comment.