mirror of
https://github.com/Team4388/RiseOfRidgebotics2020.git
synced 2026-06-09 00:38:00 -06:00
Debug Storage
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
/*----------------------------------------------------------------------------*/
|
||||
/* 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 edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||
|
||||
public class InterruptSubystem extends CommandBase {
|
||||
/**
|
||||
* Creates a new InterruptSubystem.
|
||||
*/
|
||||
public InterruptSubystem(SubsystemBase subsystem) {
|
||||
// Use addRequirements() here to declare subsystem dependencies.
|
||||
addRequirements(subsystem);
|
||||
}
|
||||
|
||||
// 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 true;
|
||||
}
|
||||
}
|
||||
@@ -68,7 +68,7 @@ public class PrepChecker extends CommandBase {
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
if (m_isDrumReady && m_isAimReady && m_isHoodReady && m_isStorageReady) {
|
||||
return true;
|
||||
//return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public class ShootPrepGroup extends ParallelDeadlineGroup {
|
||||
public ShootPrepGroup(Shooter m_shooter, ShooterAim m_shooterAim, ShooterHood m_shooterHood, Storage m_storage) {
|
||||
super(
|
||||
new PrepChecker(m_shooter, m_storage),
|
||||
new StoragePrep(m_storage),
|
||||
//new StoragePrep(m_storage),
|
||||
new TrackTarget(m_shooterAim),
|
||||
new ShooterVelocityControlPID(m_shooter),
|
||||
new HoodPositionPID(m_shooterHood)
|
||||
|
||||
@@ -32,10 +32,12 @@ public class StoragePrep extends CommandBase {
|
||||
// Called every time the scheduler runs while the command is scheduled.
|
||||
@Override
|
||||
public void execute() {
|
||||
if (!m_storage.m_isStorageReadyToFire) {
|
||||
if ((m_storage.getBeamUseless() && m_storage.getBeamShooter()) || (m_startTime + StorageConstants.STORAGE_TIMEOUT) < System.currentTimeMillis()) {
|
||||
m_storage.runStorage(StorageConstants.STORAGE_SPEED);
|
||||
m_storage.m_isStorageReadyToFire = false;
|
||||
} else {
|
||||
m_storage.runStorage(0);
|
||||
m_storage.m_isStorageReadyToFire = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,12 +49,6 @@ public class StoragePrep extends CommandBase {
|
||||
// Returns true when the command should end.
|
||||
@Override
|
||||
public boolean isFinished() {
|
||||
if (!m_storage.getBeamShooter() || (m_startTime + StorageConstants.STORAGE_TIMEOUT) < System.currentTimeMillis()) {
|
||||
m_storage.m_isStorageReadyToFire = true;
|
||||
} else {
|
||||
m_storage.m_isStorageReadyToFire = false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user