Integrate Storage Commands into Fire Commands

This commit is contained in:
Keenan D. Buckley
2020-03-08 13:50:39 -06:00
parent 0db12332dc
commit cc232cf574
3 changed files with 12 additions and 8 deletions
+8 -6
View File
@@ -105,12 +105,6 @@ public final class Constants {
public static final double TICKS_PER_INCH_LOW = TICKS_PER_WHEEL_REV_LOW/INCHES_PER_WHEEL_REV;
public static final double INCHES_PER_TICK_LOW = 1/TICKS_PER_INCH_LOW;
}
public static final class IntakeConstants {;
public static final double EXTENDER_SPEED = 0.3;
public static final int INTAKE_SPARK_ID = 12;
public static final int EXTENDER_SPARK_ID = 13;
}
public static final class ShooterConstants {
/* Motor IDs */
@@ -156,6 +150,14 @@ public final class Constants {
public static final class LevelerConstants {
public static final int LEVELER_CAN_ID = 15;
}
public static final class IntakeConstants {;
public static final double EXTENDER_SPEED = 0.3;
public static final double INTAKE_SPEED = 1.0;
public static final int INTAKE_SPARK_ID = 12;
public static final int EXTENDER_SPARK_ID = 13;
}
public static final class StorageConstants {
public static final int STORAGE_CAN_ID = 11;
@@ -29,8 +29,8 @@ public class ShootFireGroup extends ParallelRaceGroup {
addCommands(
new RunCommand(() -> m_shooter.runDrumShooterVelocityPID(m_shooter.addFireVel()), m_shooter),
new RunCommand(() -> m_shooterHood.runAngleAdjustPID(m_shooterHood.addFireAngle()), m_shooterHood),
new TrackTarget(m_shooterAim)
//new StorageFire(m_storage)
new TrackTarget(m_shooterAim),
new StorageFire(m_storage)
);
}
}
@@ -44,8 +44,10 @@ public class StoragePrep extends CommandBase {
@Override
public boolean isFinished() {
if (!m_storage.getBeamShooter() || (startTime + StorageConstants.STORAGE_TIMEOUT) < System.currentTimeMillis()) {
m_storage.m_isStorageReadyToFire = true;
return true;
} else {
m_storage.m_isStorageReadyToFire = false;
return false;
}
}