Rework Command Constructors to Make Sense

Subsystems passed through the command are requirements, while subsystems gotten from other subsystems in the constructor are for reference only.
This commit is contained in:
Keenan D. Buckley
2020-03-03 00:12:38 -07:00
parent 8f6578a47b
commit 1b603d4f5d
8 changed files with 32 additions and 31 deletions
@@ -17,16 +17,14 @@ public class ShooterVelocityControlPID extends CommandBase {
Shooter m_shooter;
double m_targetVel;
double m_actualVel;
private ShooterHood m_shooterHood;
/**
* Runs the drum at a velocity
* @param subsystem The Shooter subsytem
*/
public ShooterVelocityControlPID(Shooter subsystem, ShooterHood subHood) {
public ShooterVelocityControlPID(Shooter subsystem) {
m_shooter = subsystem;
m_shooterHood = subHood;
addRequirements(m_shooter, m_shooterHood);
addRequirements(m_shooter);
}
// Called when the command is initially scheduled.
@@ -39,7 +37,7 @@ public class ShooterVelocityControlPID extends CommandBase {
@Override
public void execute() {
m_shooter.runDrumShooterVelocityPID(/*m_shooter.addFireVel()*/13000);
m_shooterHood.runAngleAdjustPID(m_shooterHood.addFireAngle());
//m_shooterHood.runAngleAdjustPID(m_shooterHood.addFireAngle());
//SmartDashboard.putNumber("Fire Velocity", m_shooter.addFireVel());
//SmartDashboard.putNumber("Fire Angle", m_shooter.addFireAngle());
}