From 920adede82889bf3283dee46db569d7dfd9a9e1e Mon Sep 17 00:00:00 2001 From: buildmine10 <33100363+buildmine10@users.noreply.github.com> Date: Thu, 8 Apr 2021 18:29:30 -0400 Subject: [PATCH] Removed old code --- .../java/frc/robot/commands/FeederOff.java | 46 ----------------- .../java/frc/robot/commands/FeederOn.java | 48 ------------------ .../java/frc/robot/commands/KickerOff.java | 45 ----------------- .../java/frc/robot/commands/KickerOn.java | 46 ----------------- .../frc/robot/commands/MaintainFlyWheel.java | 46 ----------------- src/main/java/frc/robot/commands/Shoot.java | 33 ------------ .../frc/robot/commands/SpinUpFlyWheel.java | 50 ------------------- .../java/frc/robot/commands/StopFlyWheel.java | 49 ------------------ .../java/frc/robot/subsystems/Feeder.java | 44 ---------------- .../java/frc/robot/subsystems/Kicker.java | 42 ---------------- .../java/frc/robot/subsystems/Shooter.java | 43 ---------------- 11 files changed, 492 deletions(-) delete mode 100644 src/main/java/frc/robot/commands/FeederOff.java delete mode 100644 src/main/java/frc/robot/commands/FeederOn.java delete mode 100644 src/main/java/frc/robot/commands/KickerOff.java delete mode 100644 src/main/java/frc/robot/commands/KickerOn.java delete mode 100644 src/main/java/frc/robot/commands/MaintainFlyWheel.java delete mode 100644 src/main/java/frc/robot/commands/Shoot.java delete mode 100644 src/main/java/frc/robot/commands/SpinUpFlyWheel.java delete mode 100644 src/main/java/frc/robot/commands/StopFlyWheel.java delete mode 100644 src/main/java/frc/robot/subsystems/Feeder.java delete mode 100644 src/main/java/frc/robot/subsystems/Kicker.java delete mode 100644 src/main/java/frc/robot/subsystems/Shooter.java diff --git a/src/main/java/frc/robot/commands/FeederOff.java b/src/main/java/frc/robot/commands/FeederOff.java deleted file mode 100644 index a09ab05..0000000 --- a/src/main/java/frc/robot/commands/FeederOff.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 frc.robot.commands; - -import edu.wpi.first.wpilibj2.command.CommandBase; -import frc.robot.subsystems.Feeder; - -public class FeederOff extends CommandBase { - Feeder m_feeder; - /** - * Creates a new FeederOff. - */ - public FeederOff(Feeder feeder) { - // Use addRequirements() here to declare subsystem dependencies. - m_feeder = feeder; - addRequirements(feeder); - } - - // Called when the command is initially scheduled. - @Override - public void initialize() { - m_feeder.offFeeder(); - m_feeder.offSerializer(); - } - - // 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/frc/robot/commands/FeederOn.java b/src/main/java/frc/robot/commands/FeederOn.java deleted file mode 100644 index dec8d57..0000000 --- a/src/main/java/frc/robot/commands/FeederOn.java +++ /dev/null @@ -1,48 +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 frc.robot.commands; - -import edu.wpi.first.wpilibj2.command.CommandBase; -import frc.robot.subsystems.Feeder; - -public class FeederOn extends CommandBase { - Feeder m_feeder; - /** - * Creates a new FeederOn. - */ - public FeederOn(Feeder feeder) { - // Use addRequirements() here to declare subsystem dependencies. - m_feeder = feeder; - addRequirements(feeder); - } - - // Called when the command is initially scheduled. - @Override - public void initialize() { - m_feeder.onFeeder(); - m_feeder.onSerializer(); - } - - // 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) { - m_feeder.offFeeder(); - m_feeder.offSerializer(); - } - - // Returns true when the command should end. - @Override - public boolean isFinished() { - return false; - } -} diff --git a/src/main/java/frc/robot/commands/KickerOff.java b/src/main/java/frc/robot/commands/KickerOff.java deleted file mode 100644 index f153e40..0000000 --- a/src/main/java/frc/robot/commands/KickerOff.java +++ /dev/null @@ -1,45 +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 frc.robot.commands; - -import edu.wpi.first.wpilibj2.command.CommandBase; -import frc.robot.subsystems.Kicker; - -public class KickerOff extends CommandBase { - Kicker m_kicker; - /** - * Creates a new KickerOff. - */ - public KickerOff(Kicker kicker) { - // Use addRequirements() here to declare subsystem dependencies. - m_kicker = kicker; - addRequirements(kicker); - } - - // Called when the command is initially scheduled. - @Override - public void initialize() { - m_kicker.off(); - } - - // 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/frc/robot/commands/KickerOn.java b/src/main/java/frc/robot/commands/KickerOn.java deleted file mode 100644 index cb99e74..0000000 --- a/src/main/java/frc/robot/commands/KickerOn.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 frc.robot.commands; - -import edu.wpi.first.wpilibj2.command.CommandBase; -import frc.robot.subsystems.Kicker; - -public class KickerOn extends CommandBase { - Kicker m_kicker; - /** - * Creates a new KickerOn. - */ - public KickerOn(Kicker kicker) { - // Use addRequirements() here to declare subsystem dependencies. - m_kicker = kicker; - addRequirements(kicker); - } - - // Called when the command is initially scheduled. - @Override - public void initialize() { - m_kicker.on(); - } - - // 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) { - m_kicker.off(); - } - - // Returns true when the command should end. - @Override - public boolean isFinished() { - return false; - } -} diff --git a/src/main/java/frc/robot/commands/MaintainFlyWheel.java b/src/main/java/frc/robot/commands/MaintainFlyWheel.java deleted file mode 100644 index 26352c8..0000000 --- a/src/main/java/frc/robot/commands/MaintainFlyWheel.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 frc.robot.commands; - -import edu.wpi.first.wpilibj2.command.CommandBase; -import frc.robot.Constants; -import frc.robot.subsystems.Shooter; - -public class MaintainFlyWheel extends CommandBase { - Shooter m_shooter; - /** - * Creates a new MaintainFlyWheel. - */ - public MaintainFlyWheel(Shooter shooter) { - // Use addRequirements() here to declare subsystem dependencies. - m_shooter = shooter; - addRequirements(shooter); - } - - // Called when the command is initially scheduled. - @Override - public void initialize() { - m_shooter.on(Constants.SPIN_UP_RPM); - } - - // 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/frc/robot/commands/Shoot.java b/src/main/java/frc/robot/commands/Shoot.java deleted file mode 100644 index 390aefa..0000000 --- a/src/main/java/frc/robot/commands/Shoot.java +++ /dev/null @@ -1,33 +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 frc.robot.commands; - -import edu.wpi.first.wpilibj2.command.ParallelCommandGroup; -import edu.wpi.first.wpilibj2.command.SequentialCommandGroup; -import frc.robot.subsystems.Feeder; -import frc.robot.subsystems.Kicker; -import frc.robot.subsystems.Shooter; - -// NOTE: Consider using this command inline, rather than writing a subclass. For more -// information, see: -// https://docs.wpilib.org/en/latest/docs/software/commandbased/convenience-features.html -public class Shoot extends SequentialCommandGroup { - /** - * Creates a new Shoot. - */ - public Shoot(Shooter shooter, Kicker kicker, Feeder feeder) { - // Add your commands in the super() call, e.g. - // super(new FooCommand(), new BarCommand()); - - super( - new SpinUpFlyWheel(shooter), - new ParallelCommandGroup(new MaintainFlyWheel(shooter), new KickerOn(kicker), new FeederOn(feeder)) - - ); - } -} diff --git a/src/main/java/frc/robot/commands/SpinUpFlyWheel.java b/src/main/java/frc/robot/commands/SpinUpFlyWheel.java deleted file mode 100644 index bb6147b..0000000 --- a/src/main/java/frc/robot/commands/SpinUpFlyWheel.java +++ /dev/null @@ -1,50 +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 frc.robot.commands; - -import edu.wpi.first.wpilibj2.command.CommandBase; -import frc.robot.Constants; -import frc.robot.subsystems.Shooter; - -public class SpinUpFlyWheel extends CommandBase { - Shooter m_shooter; - /** - * Creates a new SpinUpFlyWheelFlyWheel. - */ - public SpinUpFlyWheel(Shooter shooter) { - // Use addRequirements() here to declare subsystem dependencies. - m_shooter = shooter; - addRequirements(shooter); - } - - // Called when the command is initially scheduled. - @Override - public void initialize() { - m_shooter.on(Constants.SPIN_UP_RPM); - } - - // 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) { - m_shooter.off(); - - } - - - - // Returns true when the command should end. - @Override - public boolean isFinished() { - return false; - } -} diff --git a/src/main/java/frc/robot/commands/StopFlyWheel.java b/src/main/java/frc/robot/commands/StopFlyWheel.java deleted file mode 100644 index 7369b6c..0000000 --- a/src/main/java/frc/robot/commands/StopFlyWheel.java +++ /dev/null @@ -1,49 +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 frc.robot.commands; - -import edu.wpi.first.wpilibj2.command.CommandBase; -import frc.robot.subsystems.Shooter; - -public class StopFlyWheel extends CommandBase { - Shooter m_shooter; - /** - * Creates a new StopFlyWheel. - */ - public StopFlyWheel(Shooter shooter) { - // Use addRequirements() here to declare subsystem dependencies. - m_shooter = shooter; - addRequirements(shooter); - } - - public StopFlyWheel() { - // Use addRequirements() here to declare subsystem dependencies. - } - - // Called when the command is initially scheduled. - @Override - public void initialize() { - m_shooter.off(); - } - - // 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/frc/robot/subsystems/Feeder.java b/src/main/java/frc/robot/subsystems/Feeder.java deleted file mode 100644 index d6d9160..0000000 --- a/src/main/java/frc/robot/subsystems/Feeder.java +++ /dev/null @@ -1,44 +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 frc.robot.subsystems; - -import edu.wpi.first.wpilibj2.command.SubsystemBase; -import frc.robot.Constants; -import frc.robot.Utility.Motor; - -public class Feeder extends SubsystemBase { - Motor m_feederMotor = new Motor(Constants.FEEDER_MOTOR_ID, Motor.MotorType.CANSparkMax); - Motor m_serializerMotor = new Motor(Constants.SERIALIZER_MOTOR_ID, Motor.MotorType.CANSparkMax); - /** - * Creates a new Feeder. - */ - public Feeder() { - - } - - @Override - public void periodic() { - // This method will be called once per scheduler run - } - - public void onFeeder() { - m_feederMotor.set(Motor.ControlMode.PercentOutput, 1); - } - - public void offFeeder() { - m_feederMotor.set(Motor.ControlMode.PercentOutput, 0); - } - - public void onSerializer() { - m_serializerMotor.set(Motor.ControlMode.PercentOutput, 1); - } - - public void offSerializer() { - m_serializerMotor.set(Motor.ControlMode.PercentOutput, 0); - } -} diff --git a/src/main/java/frc/robot/subsystems/Kicker.java b/src/main/java/frc/robot/subsystems/Kicker.java deleted file mode 100644 index 33856f5..0000000 --- a/src/main/java/frc/robot/subsystems/Kicker.java +++ /dev/null @@ -1,42 +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 frc.robot.subsystems; - - -import edu.wpi.first.wpilibj2.command.SubsystemBase; -import frc.robot.Constants; -import frc.robot.Utility.Motor; - -public class Kicker extends SubsystemBase { - Motor m_kickerMotor = new Motor(Constants.KICKER_MOTOR_ID, Motor.MotorType.CANSparkMax); - - - - - /** - * Creates a new Kicker. - */ - public Kicker() { - - } - - @Override - public void periodic() { - // This method will be called once per scheduler run - } - - - public void on() { - m_kickerMotor.set(Motor.ControlMode.PercentOutput, 1); - } - - public void off() { - m_kickerMotor.set(Motor.ControlMode.PercentOutput, 0); - } - -} diff --git a/src/main/java/frc/robot/subsystems/Shooter.java b/src/main/java/frc/robot/subsystems/Shooter.java deleted file mode 100644 index 866914e..0000000 --- a/src/main/java/frc/robot/subsystems/Shooter.java +++ /dev/null @@ -1,43 +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 frc.robot.subsystems; - -import edu.wpi.first.wpilibj2.command.SubsystemBase; -import frc.robot.Constants; -import frc.robot.Utility.Motor; - -public class Shooter extends SubsystemBase { - Motor m_leftMaster = new Motor(Constants.SHOOTER_LEFT_MASTER_ID, Motor.MotorType.TalonFX); - Motor m_rightSlave = new Motor(Constants.SHOOTER_RIGHT_SLAVE_ID, Motor.MotorType.TalonFX); - /** - * Creates a new Shooter. - */ - public Shooter() { - m_leftMaster.configFeedforward(Constants.SHOOTER_KS, Constants.SHOOTER_KV, Constants.SHOOTER_KA); - - m_rightSlave.follow(m_leftMaster, true); - m_leftMaster.setInverted(false); - - - m_leftMaster.enableBrakeMode(false); - m_rightSlave.enableBrakeMode(false); - } - - @Override - public void periodic() { - // This method will be called once per scheduler run - } - - public void on(double RPM) { - m_leftMaster.set(Motor.ControlMode.Velocity, RPM); - } - - public void off() { - m_leftMaster.set(Motor.ControlMode.PercentOutput, 0); - } -}