Split shooter.java

This commit is contained in:
ryan123rudder
2020-02-21 21:58:56 -07:00
parent 29a2dae680
commit 653d9908ad
8 changed files with 122 additions and 83 deletions
@@ -20,7 +20,7 @@ public class StorageIntakeGroup extends SequentialCommandGroup {
*/
public StorageIntakeGroup(Intake m_intake, Storage m_storage) {
addCommands(
new storagePrepIntake(m_intake, m_storage),
new StoragePrepIntake(m_intake, m_storage),
new storageIntake(m_intake, m_storage),
new StorageIntakeFinal(m_storage));
}
@@ -11,6 +11,7 @@ import frc4388.robot.Constants.ShooterConstants;
import frc4388.robot.Constants.VisionConstants;
import frc4388.robot.subsystems.Drive;
import frc4388.robot.subsystems.Shooter;
import frc4388.robot.subsystems.ShooterAim;
import frc4388.utility.controller.IHandController;
import edu.wpi.first.wpilibj2.command.CommandBase;
import edu.wpi.first.networktables.NetworkTable;
@@ -21,6 +22,7 @@ import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
public class TrackTarget extends CommandBase {
//Setup
NetworkTableEntry xEntry;
ShooterAim m_shooterAim;
Shooter m_shooter;
IHandController m_driverController;
//Aiming
@@ -35,7 +37,8 @@ public class TrackTarget extends CommandBase {
/**
* Uses the Limelight to track the target
*/
public TrackTarget(Shooter shooterSubsystem) {
public TrackTarget(Shooter shooterSubsystem, ShooterAim aimSubsystem) {
m_shooterAim = aimSubsystem;
m_shooter = shooterSubsystem;
addRequirements(m_shooter);
NetworkTableInstance.getDefault().getTable("limelight").getEntry("camMode").setNumber(1);
@@ -65,7 +68,7 @@ public class TrackTarget extends CommandBase {
//Deadzones
else if(turnAmount > 0 && turnAmount < VisionConstants.MOTOR_DEAD_ZONE){turnAmount = VisionConstants.MOTOR_DEAD_ZONE;}
else if(turnAmount < 0 && turnAmount > -VisionConstants.MOTOR_DEAD_ZONE){turnAmount = -VisionConstants.MOTOR_DEAD_ZONE;}
m_shooter.runShooterWithInput(turnAmount/5);
m_shooterAim.runShooterWithInput(turnAmount/5);
//Finding Distance
distance = VisionConstants.TARGET_HEIGHT/Math.tan((VisionConstants.LIME_ANGLE + yAngle)*(Math.PI/180));
@@ -10,12 +10,12 @@ package frc4388.robot.commands;
import edu.wpi.first.wpilibj2.command.CommandBase;
import frc4388.robot.subsystems.Storage;
public class storageOutake extends CommandBase {
public class StorageOutake extends CommandBase {
Storage m_storage;
/**
* Creates a new storageOutake.
*/
public storageOutake(Storage storeSub) {
public StorageOutake(Storage storeSub) {
m_storage = storeSub;
addRequirements(m_storage);
}
@@ -10,12 +10,12 @@ package frc4388.robot.commands;
import edu.wpi.first.wpilibj2.command.CommandBase;
import frc4388.robot.subsystems.Storage;
public class storagePrepAim extends CommandBase {
public class StoragePrepAim extends CommandBase {
Storage m_storage;
/**
* Creates a new storagePrepAim.
*/
public storagePrepAim(Storage storeSub) {
public StoragePrepAim(Storage storeSub) {
m_storage = storeSub;
addRequirements(m_storage);
}
@@ -11,13 +11,13 @@ import edu.wpi.first.wpilibj2.command.CommandBase;
import frc4388.robot.subsystems.Intake;
import frc4388.robot.subsystems.Storage;
public class storagePrepIntake extends CommandBase {
public class StoragePrepIntake extends CommandBase {
public Intake m_intake;
public Storage m_storage;
/**
* Creates a new storagePrepIntake.
*/
public storagePrepIntake(Intake inSub, Storage storeSub) {
public StoragePrepIntake(Intake inSub, Storage storeSub) {
m_intake = inSub;
m_storage = storeSub;
addRequirements(m_intake);