diff --git a/src/main/java/frc4388/robot/commands/storage/StorageIntake.java b/src/main/java/frc4388/robot/commands/storage/StorageIntake.java deleted file mode 100644 index 47769c4..0000000 --- a/src/main/java/frc4388/robot/commands/storage/StorageIntake.java +++ /dev/null @@ -1,63 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) 2019 FIRST. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -package frc4388.robot.commands.storage; - -import edu.wpi.first.wpilibj2.command.CommandBase; -import frc4388.robot.Constants.StorageConstants; -import frc4388.robot.subsystems.Intake; -import frc4388.robot.subsystems.Storage; - -public class StorageIntake extends CommandBase { - public Intake m_intake; - public Storage m_storage; - public boolean intook; - /** - * Runs the Storage in for intaking - * @param inSub The Intake subsystem - * @param storeSub The Storage subsytem - */ - public StorageIntake(Intake inSub, Storage storeSub) { - m_intake = inSub; - m_storage = storeSub; - addRequirements(m_intake); - addRequirements(m_storage); - } - - // Called when the command is initially scheduled. - @Override - public void initialize() { - intook = false; - } - - // Called every time the scheduler runs while the command is scheduled. - @Override - public void execute() { - - if (!m_storage.getBeam(StorageConstants.BEAM_SENSOR_STORAGE) && !m_storage.getBeam(StorageConstants.BEAM_SENSOR_INTAKE)){ - m_storage.runStorage(StorageConstants.STORAGE_SPEED); - intook = true; - } - else{ - m_storage.runStorage(0); - } - } - - // Called once the command ends or is interrupted. - @Override - public void end(boolean interrupted) { - } - - // Returns true when the command should end. - @Override - public boolean isFinished() { - if (m_storage.getBeam(StorageConstants.BEAM_SENSOR_STORAGE) && intook){ - return true; - } - return false; - } -} diff --git a/src/main/java/frc4388/robot/commands/storage/StorageIntakeFinal.java b/src/main/java/frc4388/robot/commands/storage/StorageIntakeFinal.java deleted file mode 100644 index 0d8c447..0000000 --- a/src/main/java/frc4388/robot/commands/storage/StorageIntakeFinal.java +++ /dev/null @@ -1,40 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) 2019 FIRST. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -package frc4388.robot.commands.storage; - -import edu.wpi.first.wpilibj2.command.CommandBase; - -public class StorageIntakeFinal extends CommandBase { - /** - * Creates a new StorageIntakeFinal. - */ - public StorageIntakeFinal() { - // Use addRequirements() here to declare subsystem dependencies. - } - - // Called when the command is initially scheduled. - @Override - public void initialize() { - } - - // Called every time the scheduler runs while the command is scheduled. - @Override - public void execute() { - } - - // Called once the command ends or is interrupted. - @Override - public void end(boolean interrupted) { - } - - // Returns true when the command should end. - @Override - public boolean isFinished() { - return false; - } -} diff --git a/src/main/java/frc4388/robot/commands/storage/StorageOutake.java b/src/main/java/frc4388/robot/commands/storage/StorageOutake.java deleted file mode 100644 index 658d8e5..0000000 --- a/src/main/java/frc4388/robot/commands/storage/StorageOutake.java +++ /dev/null @@ -1,46 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) 2019 FIRST. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -package frc4388.robot.commands.storage; - -import edu.wpi.first.wpilibj2.command.CommandBase; -import frc4388.robot.Constants.StorageConstants; -import frc4388.robot.subsystems.Storage; - -public class StorageOutake extends CommandBase { - Storage m_storage; - /** - * Runs the Storage out for outaking - * @param storeSub The Storage subsystem - */ - public StorageOutake(Storage storeSub) { - m_storage = storeSub; - addRequirements(m_storage); - } - - // Called when the command is initially scheduled. - @Override - public void initialize() { - } - - // Called every time the scheduler runs while the command is scheduled. - @Override - public void execute() { - m_storage.runStorage(-StorageConstants.STORAGE_SPEED); - } - - // Called once the command ends or is interrupted. - @Override - public void end(boolean interrupted) { - } - - // Returns true when the command should end. - @Override - public boolean isFinished() { - return false; - } -} diff --git a/src/main/java/frc4388/robot/commands/storage/StoragePositionPID.java b/src/main/java/frc4388/robot/commands/storage/StoragePositionPID.java deleted file mode 100644 index 2a27b41..0000000 --- a/src/main/java/frc4388/robot/commands/storage/StoragePositionPID.java +++ /dev/null @@ -1,52 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) 2019 FIRST. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -package frc4388.robot.commands.storage; - -import edu.wpi.first.wpilibj2.command.CommandBase; -import frc4388.robot.Constants.StorageConstants; -import frc4388.robot.subsystems.Storage; - -public class StoragePositionPID extends CommandBase { - public Storage m_storage; - double startPos; - /** - * Moves the storage a number of rotations - * @param subsystem The Storage subsystem - */ - public StoragePositionPID(Storage subsystem) { - m_storage = subsystem; - addRequirements(m_storage); - } - - // Called when the command is initially scheduled. - @Override - public void initialize() { - - } - - // Called every time the scheduler runs while the command is scheduled. - @Override - public void execute() { - m_storage.runStoragePositionPID(StorageConstants.STORAGE_FULL_BALL); - } - - // Called once the command ends or is interrupted. - @Override - public void end(boolean interrupted) { - } - - // Returns true when the command should end. - @Override - public boolean isFinished() { - /*if (startPos + StorageConstants.STORAGE_FULL_BALL == m_storage.getEncoderPos()) - { - return true; - }*/ - return false; - } -} diff --git a/src/main/java/frc4388/robot/commands/storage/StoragePrepIntake.java b/src/main/java/frc4388/robot/commands/storage/StoragePrepIntake.java deleted file mode 100644 index b9a9cf1..0000000 --- a/src/main/java/frc4388/robot/commands/storage/StoragePrepIntake.java +++ /dev/null @@ -1,62 +0,0 @@ -/*----------------------------------------------------------------------------*/ -/* Copyright (c) 2019 FIRST. All Rights Reserved. */ -/* Open Source Software - may be modified and shared by FRC teams. The code */ -/* must be accompanied by the FIRST BSD license file in the root directory of */ -/* the project. */ -/*----------------------------------------------------------------------------*/ - -package frc4388.robot.commands.storage; - -import edu.wpi.first.wpilibj2.command.CommandBase; -import frc4388.robot.Constants.StorageConstants; -import frc4388.robot.subsystems.Intake; -import frc4388.robot.subsystems.Storage; - -public class StoragePrepIntake extends CommandBase { - public Intake m_intake; - public Storage m_storage; - public double startTime; - - /** - * Prepares the Storage for intaking - * @param inSub The Intake subsystem - * @param storeSub the Storage subsystem - */ - public StoragePrepIntake(Intake inSub, Storage storeSub) { - m_intake = inSub; - m_storage = storeSub; - addRequirements(m_intake); - addRequirements(m_storage); - } - - // Called when the command is initially scheduled. - @Override - public void initialize() { - startTime = System.currentTimeMillis(); - } - - // Called every time the scheduler runs while the command is scheduled. - @Override - public void execute() { - if (m_storage.getBeam(StorageConstants.BEAM_SENSOR_STORAGE)){ - m_storage.runStorage(-StorageConstants.STORAGE_SPEED); - } - else{ - m_storage.runStorage(0); - } - } - - // Called once the command ends or is interrupted. - @Override - public void end(boolean interrupted) { - } - - // Returns true when the command should end. - @Override - public boolean isFinished() { - if (!m_storage.getBeam(StorageConstants.BEAM_SENSOR_INTAKE) || startTime + StorageConstants.STORAGE_TIMEOUT <= System.currentTimeMillis()){ - return false; - } - return false; - } -}