diff --git a/src/main/java/frc4388/robot/commands/HoodAdjustPID.java b/src/main/java/frc4388/robot/commands/HoodAdjustPID.java index 2815dd5..f08db0d 100644 --- a/src/main/java/frc4388/robot/commands/HoodAdjustPID.java +++ b/src/main/java/frc4388/robot/commands/HoodAdjustPID.java @@ -13,7 +13,8 @@ import frc4388.robot.subsystems.Shooter; public class HoodAdjustPID extends CommandBase { Shooter m_shooter; /** - * Creates a new HoodAdjustPID. + * Adjusts the hood based on the limelight target angle + * @param shooterSub The Shooter subsystem */ public HoodAdjustPID(Shooter shooterSub) { m_shooter = shooterSub; diff --git a/src/main/java/frc4388/robot/commands/ShootFireGroup.java b/src/main/java/frc4388/robot/commands/ShootFireGroup.java index d0e0ab6..03371d7 100644 --- a/src/main/java/frc4388/robot/commands/ShootFireGroup.java +++ b/src/main/java/frc4388/robot/commands/ShootFireGroup.java @@ -18,16 +18,17 @@ import frc4388.robot.subsystems.Storage; // https://docs.wpilib.org/en/latest/docs/software/commandbased/convenience-features.html public class ShootFireGroup extends ParallelRaceGroup { /** - * Creates a new ShootFireGroup. + * Fires the shooter + * @param m_shooter The Shooter subsytem + * @param m_shooterAim The ShooterAim subsystem + * @param m_storage The Storage subsytem */ public ShootFireGroup(Shooter m_shooter, ShooterAim m_shooterAim, Storage m_storage) { - - // Add your commands in the super() call, e.g. - // super(new FooCommand(), new BarCommand()); super( new ShooterVelocityControlPID(m_shooter, m_shooter.addFireVel()), - new RunCommand(() -> m_shooter.runAngleAdjustPID(m_shooter.addFireAngle())), - new TrackTarget(m_shooter, m_shooterAim) + new HoodAdjustPID(m_shooter), + new TrackTarget(m_shooter, m_shooterAim), + new StorageRun(m_storage) ); } } diff --git a/src/main/java/frc4388/robot/commands/ShootFullGroup.java b/src/main/java/frc4388/robot/commands/ShootFullGroup.java index 9da770d..63bc7ec 100644 --- a/src/main/java/frc4388/robot/commands/ShootFullGroup.java +++ b/src/main/java/frc4388/robot/commands/ShootFullGroup.java @@ -17,12 +17,15 @@ import frc4388.robot.subsystems.Storage; // https://docs.wpilib.org/en/latest/docs/software/commandbased/convenience-features.html public class ShootFullGroup extends SequentialCommandGroup { /** - * Creates a new ShootFullGroup. + * Preps and Fires the Shooter + * @param m_shooter The Shooter subsytem + * @param m_shooterAim The ShooterAim subsystem + * @param m_storage The Storage subsytem */ public ShootFullGroup(Shooter m_shooter, ShooterAim m_shooterAim, Storage m_storage) { super( new ShootPrepGroup(m_shooter, m_shooterAim, m_storage), - new ShootFireGroup() + new ShootFireGroup(m_shooter, m_shooterAim, m_storage) ); } } diff --git a/src/main/java/frc4388/robot/commands/ShootPrepGroup.java b/src/main/java/frc4388/robot/commands/ShootPrepGroup.java index 1b17fda..ffbc2b5 100644 --- a/src/main/java/frc4388/robot/commands/ShootPrepGroup.java +++ b/src/main/java/frc4388/robot/commands/ShootPrepGroup.java @@ -19,6 +19,9 @@ import frc4388.robot.subsystems.Storage; public class ShootPrepGroup extends ParallelCommandGroup { /** * Preps the Shooter to be fired + * @param m_shooter The Shooter subsytem + * @param m_shooterAim The ShooterAim subsystem + * @param m_storage The Storage subsytem */ public ShootPrepGroup(Shooter m_shooter, ShooterAim m_shooterAim, Storage m_storage) { super( diff --git a/src/main/java/frc4388/robot/commands/ShooterVelocityControlPID.java b/src/main/java/frc4388/robot/commands/ShooterVelocityControlPID.java index f4aeae8..4da0fe3 100644 --- a/src/main/java/frc4388/robot/commands/ShooterVelocityControlPID.java +++ b/src/main/java/frc4388/robot/commands/ShooterVelocityControlPID.java @@ -16,6 +16,8 @@ public class ShooterVelocityControlPID extends CommandBase { double m_actualVel; /** * Creates a new ShooterVelocityControlPID. + * @param subsystem The Shooter subsytem + * @param targetVel The target velocity */ public ShooterVelocityControlPID(Shooter subsystem, double targetVel) { // Use addRequirements() here to declare subsystem dependencies. diff --git a/src/main/java/frc4388/robot/commands/StorageRun.java b/src/main/java/frc4388/robot/commands/StorageRun.java new file mode 100644 index 0000000..5b56b52 --- /dev/null +++ b/src/main/java/frc4388/robot/commands/StorageRun.java @@ -0,0 +1,45 @@ +/*----------------------------------------------------------------------------*/ +/* 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; + +import edu.wpi.first.wpilibj2.command.CommandBase; +import frc4388.robot.Constants.StorageConstants; +import frc4388.robot.subsystems.Storage; + +public class StorageRun extends CommandBase { + Storage m_storage; + /** + * Runs the Storage at a speed + * @param storageSub The Storage subsytem + */ + public StorageRun(Storage storageSub) { + m_storage = storageSub; + } + + // 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; + } +}